Easy Tutorial
❮ Jquery Dom Remove Sel Firstchild ❯

jQuery event.delegateTarget Property

jQuery Event Methods

Example

Change the background color of the <div> element (ancestor of the <button> element):


Definition and Usage

The event.delegateTarget property returns the element where the currently called jQuery event handler was attached.

This property is particularly useful for delegated events added by the on() method, where the event handler is added when the ancestor element is processed.

Tip: If the event is directly bound to the element and no delegation occurs, event.delegateTarget is the same as event.currentTarget (see the example below).


Syntax

Parameter Description
event Required. The event parameter comes from the event binding function.

More Examples

Difference between delegateTarget and currentTarget with delegation

delegateTarget and currentTarget are equal for directly bound events


jQuery Event Methods

❮ Jquery Dom Remove Sel Firstchild ❯