jQuery Reference Manual - Events

jQuery event methods

Event methods will trigger the event of the matching elements or bind a function to an event of all matching elements.

Trigger instance:

$("button#demo").click()

The example above will trigger the click event of the button element with id="demo".

Binding instance:

$("button#demo").click(function(){$("img").hide()})

The example above will hide all images when the button with id="demo" is clicked.

Method Description
bind() Attach one or more event handlers to the matching elements
blur() Trigger or bind a function to the blur event of the specified element
change() Trigger or bind a function to the change event of the specified element
click() Trigger or bind a function to the click event of the specified element
dblclick() Trigger or bind a function to the double click event of the specified element
delegate() Attach one or more event handlers to the current or future child elements of the matching elements
die() Remove all event handlers added through the live() function.
error() Trigger or bind a function to the error event of the specified element
event.isDefaultPrevented() Return whether event.preventDefault() was called on the event object.
event.pageX The mouse position relative to the left edge of the document.
event.pageY The mouse position relative to the top edge of the document.
event.preventDefault() Prevent the default action of the event.
event.result Contains the last value returned by the event handler triggered by the specified event.
event.target The DOM element that triggered the event.
event.timeStamp This property returns the number of milliseconds from January 1, 1970, to the time the event occurred.
event.type Describe the type of the event.
event.which Indicate which key or button was pressed.
focus() Trigger or bind a function to the focus event of the specified element
keydown() Trigger or bind a function to the key down event of the specified element
keypress() Trigger or bind a function to the key press event of the specified element
keyup() Trigger or bind a function to the key up event of the specified element
live() Add one or more event handlers to the current or future matched elements
load() Trigger or bind a function to the load event of the specified element
mousedown() Trigger or bind a function to the mouse down event of the specified element
mouseenter() Trigger or bind a function to the mouse enter event of the specified element
mouseleave() Trigger or bind a function to the mouse leave event of the specified element
mousemove() Trigger or bind a function to the mouse move event of the specified element
mouseout() Trigger or bind a function to the mouse out event of the specified element
mouseover() Trigger or bind a function to the mouse over event of the specified element
mouseup() Trigger or bind a function to the mouse up event of the specified element
one() Add an event handler to the matched elements. Each element can only trigger this handler once.
ready() Document Ready Event (when the HTML document is ready and available)
resize() Trigger or bind a function to the resize event of the specified element
scroll() Trigger or bind a function to the scroll event of the specified element
select() Trigger or bind a function to the select event of the specified element
submit() Trigger or bind a function to the submit event of the specified element
toggle() Bind two or more event handler functions to be executed when a click event occurs in turn.
trigger() The specified event of all matched elements
triggerHandler() The first matched element's specified event
unbind() Remove an event handler added to the matched elements
undelegate() Remove an event handler added to the matched elements, now or in the future
unload() Trigger or bind a function to the unload event of the specified element

See Also

Tutorial:jQuery Element Selector Syntax