Latest web development tutorials

relatedTarget event properties

Event Object Reference Event objects

Definition and Usage

relatedTarget event property returns the target node node-related events.

For mouseover events, it is this property that node when the mouse pointer over the target node to leave.

For mouseout events, it is the property away from the target, the mouse pointer enters the node.

For other types of events, this property is not available.

grammar

event.relatedTarget

Examples

Examples

The following example returns the element pointer just left:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function getRelatedElement (event) {
alert ( "the mouse pointer over the" + event.relatedTarget.tagName + "element");
}
</ Script>
</ Head>
<Body>

<P onmouseover = "getRelatedElement (event)"> Move your mouse over this period. </ P>

</ Body>
</ Html>

try it"


Event Object Reference Event objects