jQuery Event Object
The following section contains a brief overview of jQuery event object.
jQuery Event Object
This section contains a brief overview of jQuery's event object and its properties.
Method | Description |
---|---|
event.currentTarget |
The current DOM element within the event bubbling phase. |
event.data |
An optional object of data passed to an event method when the current executing handler is bound. |
event.delegateTarget |
Returns the element where the currently-called jQuery event handler was attached. |
event.isDefaultPrevented() |
Returns whether event.preventDefault() was ever called on this event object. |
event.isImmediatePropagationStopped() |
Returns whether event.stopImmediatePropagation() was ever called on this event object. |
event.isPropagationStopped() |
Returns whether event.stopPropagation() was ever called on this event object. |
event.metaKey |
Indicates whether the Windows key or Command key (on Mac keyboard) was pressed when the event fired. |
event.namespace |
Returns the namespace specified when the event was triggered. |
event.pageX |
Returns the mouse position relative to the left edge of the document. |
event.pageY |
Returns the mouse position relative to the top edge of the document. |
event.preventDefault() |
If this method is called, the default action of the event will not be triggered. |
event.relatedTarget |
Returns the other DOM element involved in the event, if any. |
event.result |
The last or previous value returned by an event handler that was triggered by this event. |
event.stopImmediatePropagation() |
Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. |
event.stopPropagation() |
Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. |
event.target |
Returns the DOM element that triggered the event. |
event.timeStamp |
Returns difference in milliseconds between the time the event is triggered and January 1, 1970. |
event.type |
Returns the type of event that was triggered. |
event.which |
Indicates the specific key or button that was pressed for key or mouse events. |