target event property
Event Object
Definition and Usage
The target event property returns the target node of the event (the node that triggered the event), such as the element, document, or window that generated the event.
Syntax
event
.target
Example
Example
The following example gets the element that triggered the event:
Click a paragraph. An alert box will indicate the element that triggered the event.
Note:The target property returns the element that triggered the event, and is not necessarily the element of the event listener.
Try it »
Event Object