In Internet Explorer®, we can declare event handling code and use the for and event attributes of the SCRIPT element to associate the code with the event.
The following example defines JavaScript code and associates it as the onmouseover event handler for the IMG element having the identifier theImg.
<script language="JavaScript"
for=theImg
event=onmouseover>
... JavaScript code ...
</script>
<img id="theImg" src="sample.gif">
Notice that in this case, there is no call to the onmouseover event handler of the object itself. It is declared in the event attribute of the SCRIPT tag.