Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

target event property

target event property

Event Object Reference 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:

Runoob Tutorial(runoob.com)

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 Reference Event Object