cesarr,
<!DOCTYPE HTML>
<html>
<head> </head>
<body>
<div id="t"> click me </div>
<script>
var elem = document.getElementById("t");
t.onclick = function () {
if(this.style.backgroundColor)
this.style.backgroundColor = "";
else
this.style.backgroundColor = "red";
}
</script>
</body>
</html>