jQuery event method
The event method triggers or adds a function to the selected element's event handler.
The table below lists all jQuery methods for handling events.
method | describe |
---|---|
bind() | Add event handlers to elements |
blur() | Add/trigger lose focus event |
change() | Add/trigger change event |
click() | Add/trigger click event |
dblclick() | Add/trigger double click event |
delegate() | Adds a handler to current or future child elements of the matched element |
die() | Removed in version 1.9. Removes any event handlers added via the live() method |
error() | Deprecated in version 1.8. Add/trigger error event |
event.currentTarget | The current DOM element within the event bubbling phase |
event.data | Contains optional data passed to the event method when the currently executing handler is bound |
event.delegateTarget | Returns the element added by the currently invoked jQuery event handler |
event.isDefaultPrevented() | Returns whether event.preventDefault() is called on the specified event object |
event.isImmediatePropagationStopped() | Returns whether event.stopImmediatePropagation() is called on the specified event object |
event.isPropagationStopped() | Returns whether event.stopPropagation() is called on the specified event object |
event.namespace | Returns the namespace specified when the event was fired |
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() | Default behavior for blocking events |
event.relatedTarget | Returns which element enters or exits when the mouse is moved |
event.result | Contains the last value returned by an event handler fired by the specified event |
event.stopImmediatePropagation() | prevent other event handlers from being called |
event.stopPropagation() | Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event |
event.target | Returns which DOM element triggered the event |
event.timeStamp | Returns the number of milliseconds since January 1, 1970, when the event was fired |
event.type | Returns which event type was fired |
event.which | Returns which keyboard key or mouse button was pressed on the specified event |
event.metaKey | Whether the META key was pressed when the event was triggered |
focus() | Add/trigger focus event |
focusin() | Add event handler to focusin event |
focusout() | Add event handler to focusout event |
hover() | Add two event handlers to the hover event |
keydown() | Add/trigger keydown event |
keypress() | Add/trigger keypress event |
keyup() | Add/trigger keyup event |
live() | Removed in version 1.9. Adds one or more event handlers to the current or future selected elements |
load() | Deprecated in version 1.8. Add an event handler to the load event |
mousedown() | Add/trigger mousedown event |
mouseenter() | Add/trigger mouseenter event |
mouseleave() | Add/trigger mouseleave event |
mousemove() | Add/trigger mousemove event |
mouseout() | Add/trigger mouseout event |
mouseover() | Add/trigger mouseover event |
mouseup() | Add/trigger mouseup event |
off() | Remove event handlers added via the on() method |
on() | Add event handlers to elements |
one() | Adds one or more event handlers to the selected elements. This handler can only be triggered once per element |
$.proxy() | takes an existing function and returns a new function with a specific context |
ready() | Specifies a function to be executed when the DOM is fully loaded |
resize() | Add/trigger resize event |
scroll() | Add/trigger scroll event |
select() | Add/trigger select event |
submit() | Add/trigger submit event |
toggle() | Removed in version 1.9. Add two or more functions to toggle between click events |
trigger() | Fires all events bound to the selected elements |
triggerHandler() | Triggers all functions bound to the specified event on the selected elements |
unbind() | Removes added event handlers from selected elements |
delegate() | Removes event handlers from current or future selected elements |
unload() | Deprecated in version 1.8. Add event handler to unload event |
contextmenu() | Add event handler to contextmenu event |
$.holdReady() | Used to pause or resume execution of the .ready() event |