Use this to reference the current tag : this « HTML Tags « JavaScript Tutorial






<html>
<head>
<title>Style Example</title>
</head>
<body>
<P>Move your mouse over the square.</p>
<div id="div1"
     style="background-color: red; height: 50px; width: 50px"
     onmouseover="this.style.backgroundColor = 'blue'"
     onmouseout="this.style.backgroundColor = 'red'">
</div>
</body>
</html>








21.15.this
21.15.1.Use this to reference the current tag