jQuery Event Handler Methods

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().
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():
$("#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 methodsPrefer these APIs for all new jQuery code — direct and delegated handlers.
Fire Events
2 methodsProgrammatically invoke handlers and optional native behaviors.
| Method | Description | Tutorial |
|---|---|---|
.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 methodFix this for callbacks — prefer native .bind() over $.proxy() in new code.
Legacy APIs
5 methodsDeprecated or removed binders — keep for migration from older jQuery apps.
| Method | Description | Tutorial |
|---|---|---|
.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 methodsRun cleanup when the user leaves the page.
Frequently Asked Questions
Start with .on()
Open the binding guide—syntax, examples, and FAQs.
16 people found this page helpful
