Description
The event.target property specifies which DOM element triggered the event.
v1.0
This method has the form:
event.target
Parameter | Description |
---|---|
event | (required) Specifies the event to check. The event parameter comes from the event binding function |
Return Value
This form returns an Element object.
Examples
The following example shows which event type was triggered:
$("p, button, h1, h2").click(
function(event){
$("div").html("Triggered by: "
+ event.target.nodeName);
});