jQuery Event Handler Methods

Beginner
7 min read
Updated: Nov 2026
13 method guides
Method index

About This Index

This page is the jQuery Event Handler index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Learn the jQuery overview on /jquery. Use this page when you need an Event Handler API such as .on(), .off(), or .trigger().

Beginner path.

Start with .on() and .off(), then .one() and .trigger()—read legacy guides only when migrating older jQuery code.

How to Call an Event Handler Method

Prefer .on() for direct and delegated binding; remove with .off():

jQuery
$("#btn").on("click", function () {
  console.log("clicked");
});

$("#list").on("click", "li", function () {
  console.log($(this).text());        // works for future <li> too
});

$("#btn").one("click", fn);           // runs once
$("#btn").trigger("click");
$("#btn").off("click");

// Legacy → modern
// $("#list").delegate("li", "click", fn);
$("#list").on("click", "li", fn);

jQuery Event Handler Methods Table

All Event Handler method guides in this jQuery tutorial series (13 tutorials).

Modern Binding

3 methods

Prefer these APIs for all new jQuery code — direct and delegated handlers.

MethodDescriptionTutorial
.on()Attach direct or delegated handlers — namespaces, eventData, and multi-event maps.Try it
.one()Attach a handler that runs at most once per element per event type.Try it
.off()Remove handlers attached with .on() — by type, namespace, selector, or function.Try it

Fire Events

2 methods

Programmatically invoke handlers and optional native behaviors.

MethodDescriptionTutorial
.trigger()Fire handlers and native behaviors for an event type — pass extra data.Try it
.triggerHandler()Run jQuery handlers only — no bubbling or native default actions.Try it

Handler Context

1 method

Fix this for callbacks — prefer native .bind() over $.proxy() in new code.

MethodDescriptionTutorial
$.proxy()Return a function with a fixed this — prefer Function.prototype.bind() in new code.Try it

Legacy APIs

5 methods

Deprecated or removed binders — keep for migration from older jQuery apps.

MethodDescriptionTutorial
.delegate()Legacy delegated binding — migrate to .on(event, selector, handler).Try it
.undelegate()Legacy removal for .delegate() handlers — migrate to .off().Try it
.live()Legacy document-level delegation — removed in 1.9; use $(document).on().Try it
.die()Legacy removal for .live() handlers — removed in 1.9; use .off().Try it
.unbind()Legacy direct unbind for .bind() handlers — migrate to .off().Try it

Page Unload

2 methods

Run cleanup when the user leaves the page.

MethodDescriptionTutorial
unloadBind page-exit handlers with .on('unload') on window.Try it
.unload()Legacy unload shorthand — removed in jQuery 3.0; use .on('unload').Try it

Frequently Asked Questions

They attach, remove, and fire functions for DOM events. Direct binding targets the current collection; delegated binding listens on a parent and filters descendants with a selector—including elements added later.
Use .on() to bind and .off() to unbind. They replace .bind(), .unbind(), .delegate(), .undelegate(), and .live(). Use .one() when a handler should run only once.
Direct: $('#btn').on('click', fn) requires #btn to exist now. Delegated: $('#list').on('click', 'li', fn) handles clicks from current and future li elements inside #list.
Swap the first two arguments: .delegate('li', 'click', fn) becomes .on('click', 'li', fn). Remove with .off('click', 'li') instead of .undelegate().
Start with .on() and .off(), then .one() and .trigger(). Read the legacy guides only when updating older jQuery code.

Start with .on()

Open the binding guide—syntax, examples, and FAQs.

.on() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

16 people found this page helpful