Appendix D. Events

The following table contains all of the event methods supported by jQuery as listed in jQuery's official documentation at www.jquery.com.

All of the event methods return the jQuery object.

Method

Description

Page Load

ready(function)

Attaches a function that is executed when the DOM is completely loaded, that is, all markup, CSS, and JavaScript are loaded, but not necessarily images.

Event Handling

bind(event, function)

Attach a function that is executed when the event occurs. Multiple events can be specified in the event argument; if you specify multiple events, each event must be separated with a single space.

bind(event, data, function)

The bind() method accepts an optional data argument. The data argument is an object that is passed to the event object of the attached function as event.data.

one(event, function)

Attaches a function to be fired for the specified event. The function is only executed once. Subsequent events will not execute the specified function.

one(event, data, function)

The one() method accepts an optional data argument. The data argument is an object that is passed to the event object of the attached function as event.data.

trigger(event)

Triggers the specified event on matched elements.

trigger(event, data)

The trigger() method accepts an optional data argument. The data argument is an object that is passed to event object functions being triggered as event.data.

triggerHandler(event)

Triggers the specified event on matched elements while canceling the browser's ...

Get Beginning JavaScript® and CSS Development with jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.