event Properties DHTML Events
Internet Explorer® 5 and up only.
Retrieves the object the cursor is moving into on an onmouseover or onmouseout event.
HTML |
N/A |
Script |
[ oObject = ] event.toElement |
oObject |
Object being moved to. |
The property is read-only with no default value.
This property is Microsoft's implementation of the generic relatedNode interface specified in the DOM.
In the same manner, the relatedNode property is used to identify a secondary node related to a User Interface ( UI ) event. The DOM specifies to use relatedNode with the mouseover event to indicate the node which the pointing device exited, and with the mouseout event to indicate the node which the pointing device entered.
In the following example, the alert returns "mouse gone" when the user moves the mouse away from the button.
<script language="JavaScript">
function testMouse ( oObject ) {
if ( !oObject.contains ( event.toElement ) ) {
alert ( "mouse gone" );
}
}
</script>
...
<button id=oButton
onmouseout="testMouse ( this )">
Mouse Over This.</button>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
event
fromElement