event Properties DHTML Events
Retrieves the object the cursor is exiting on an onmouseover and onmouseout event.
HTML |
N/A |
Script |
[ oObject = ] event.fromElement |
oObject |
Element being moved. |
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 arrived" when the cursor is moved over the button.
<script language="JavaScript">
function testMouse ( oObject ) {
if ( !oObject.contains ( event.fromElement ) ) {
alert ( "mouse arrived" );
}
}
</script>
...
<button onmouseover="testMouse ( this )">
Mouse Over This.</button>
This feature requires Microsoft® Internet Explorer® 5 or later.
Show me
event
toElement