.triggerHandler() (since jQuery 1.2) runs handlers bound with jQuery for an event type on the first matched element. It is like .trigger(), but without bubbling, without native default actions, and with a handler return value instead of chaining.
Remember
$el.triggerHandler("click"); // first element only
$el.triggerHandler("check", ["extra"]); // + extra args
var result = $el.triggerHandler("validate"); // last handler return value
// vs .trigger():
// · no DOM bubbling
// · no native .focus() / .submit() side effects
// · does not return the jQuery object
Bind a handler with .on(), then call .triggerHandler() when you want that logic without side effects.
Attach a handler with .on("event", fn) (or custom event name).
Call .triggerHandler("event") on the element (first match only).
jQuery runs direct handlers on that element — nothing bubbles up.
Native defaults (focus, submit, …) are not invoked.
Capture the return value if the handler returns something useful.
Piece
Required?
Role
eventType / event
Yes
String (since 1.2) or jQuery.Event (since 1.3)
extraParameters
No
Array or object passed after the event
Target
Yes
Only the first matched element
Return value
—
Last handler’s return value, or undefined
Pseudocode
Pseudocode
call $(set).triggerHandler(eventType, extra?)
take first element in the set (ignore the rest)
if no element:
return undefined
run jQuery handlers for eventType on that element
(also on{eventType} if present on the element)
do NOT bubble to parents
do NOT call native element.eventType()
return value from the last handler that ran
(or undefined if none ran)
Reference
Cheat Sheet
Keep these differences next to .trigger().
Topic
.trigger()
.triggerHandler()
Elements
All matched
First only
Bubbling
Yes
No
Native defaults
May run
Skipped
Return
jQuery object
Handler value / undefined
Since
1.0
1.2 (Event arg 1.3)
Extra args
Supported
Supported
Try it
Live Preview
Run a custom check handler with .triggerHandler() and read its return value.
Handler returns "pass" if score ≥ 50, else "fail". No bubbling, no native side effects.
Result
Ready — set a score and click Run check.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Focus: .trigger() vs .triggerHandler()
Official idea: both run the jQuery focus handler; only .trigger() may native-focus.
jQuery
$("input").on("focus", function () {
$("#log").text("Focused!");
});
$("#old").on("click", function () {
$("input").trigger("focus"); // handler + may native-focus
});
$("#new").on("click", function () {
$("input").triggerHandler("focus"); // handler only
});
Both buttons → "Focused!" in the log
.trigger("focus") → input may also receive real browser focus
.triggerHandler("focus") → handlers only, caret may stay put
How It Works
Bind. A jQuery focus handler updates the log.
trigger. Runs handlers and may call the browser’s focus action.
triggerHandler. Runs the same handlers without native focus.
Use. Prefer triggerHandler when you want logic without moving focus.
Example 2 — Capture a Handler’s Return Value
Unlike .trigger(), you can read what the handler returned.
jQuery
$("#score").on("check", function () {
var val = parseInt($(this).text(), 10);
return val >= 50 ? "pass" : "fail";
});
$("#run").on("click", function () {
var result = $("#score").triggerHandler("check");
$("#log").text("Return value: " + result);
});
Capture.triggerHandler gives that value back to the caller.
Branch. Use it for validation without touching the DOM defaults.
Example 3 — First Matched Element Only
.trigger() hits every match; .triggerHandler() hits only the first.
jQuery
$("button.item").on("click", function () {
$("#log").append($(this).text() + " ");
});
$("#trigger-all").on("click", function () {
$("button.item").trigger("click"); // all three
});
$("#trigger-first").on("click", function () {
$("button.item").triggerHandler("click"); // Item 1 only
});
Direct binds. Child and parent each have their own click handler.
trigger. Event bubbles → parent runs too.
triggerHandler. Stays on the child — parent never sees it.
Delegated note. Handlers only on a parent (delegation) will not run via triggerHandler on the child.
Example 5 — Form Validation Without Native Submit
Dry-run a submit handler and read false / true without posting the form.
jQuery
$("form").on("submit", function () {
var name = $("input[name='name']").val().trim();
if (!name) return false;
return true;
});
$("#test").on("click", function () {
var ok = $("form").triggerHandler("submit");
$("#log").text(ok === false ? "Validation failed" : "Validation passed");
});
Empty name → Validation failed (returned false)
Filled name → Validation passed
Form never navigates / submits
How It Works
Handler. Returns false when invalid, true when valid.
Dry-run.triggerHandler("submit") does not call native .submit().
Result. You branch on the returned value.
Safety. Ideal for “test validation” buttons next to a real submit.
Edge Cases & Pitfalls
These differences surprise people coming from .trigger().
first
Only the first matched element
A multi-element set silently ignores everything after the first. Loop with .each() if needed.
bubble
No bubbling — delegated handlers miss it
Handlers bound on a parent with a child selector will not run. Bind directly on the target, or use .trigger().
return
Not chainable
Return value is the handler’s result. Do not write $el.triggerHandler("x").addClass(…).
empty
No handlers → undefined
An empty set or a missing handler returns undefined — check before treating it as true/false.
native
Native actions stay off
triggerHandler("submit") will not submit the form. That is the point — call native methods yourself if you need them.
Compatibility
Browser Support
.triggerHandler() has been part of jQuery since 1.2 (accepting a jQuery.Event since 1.3). It works in every browser that runs your loaded jQuery version.
✓ Stable · jQuery 1.2+
jQuery .triggerHandler()
Supported across jQuery 1.x, 2.x, and 3.x. Prefer a current jQuery 3.x build. Behavior differences vs .trigger() are intentional API design.
100%With jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.triggerHandler()Universal
Bottom line: Safe for dry-runs and return-value checks. Remember: first element only, no bubble, no native defaults.
Analysis
Performance Notes
Approach
Cost
Best for
triggerHandler on one node
Cheap
Validation dry-runs, plugin hooks
trigger with bubbling
Slightly more
When parents must react too
Many .each() + triggerHandler
Higher
Prefer .trigger() if all matches need it
Cost is rarely the issue — pick the method for correct side effects. Use triggerHandler when you want isolation and a return value.
Remember
Key Takeaways
Role: run jQuery handlers only — no bubble, no native defaults.
Return: last handler value (or undefined) — not chainable.
Scope: first matched element only.
Pair: use .trigger() when you need bubbling or native behavior.
One line:.triggerHandler() is a quiet dry-run of handlers — first element, no bubble, return the result.
Frequently Asked Questions
.triggerHandler() executes jQuery handlers for an event on the first matched element only. Unlike .trigger(), it does not bubble, does not invoke native defaults (like form .submit()), and returns the last handler’s return value instead of the jQuery object.
.trigger() runs on all matched elements, bubbles, may invoke native behavior, and returns the jQuery object for chaining. .triggerHandler() affects only the first element, never bubbles, skips native side effects, and returns whatever the last executed handler returned (or undefined).
Use it when you only need jQuery handlers — without submitting a form, natively focusing an input, or firing parent handlers. Also use it when you need the handler’s return value for validation or branching.
No. It returns the value from the last handler that ran. If no handlers fire, it returns undefined. Example: var ok = $('#field').triggerHandler('validate') === true.
By design. To run handlers on every match, loop with .each() and call .triggerHandler() per element, or use .trigger() instead.
Yes. Same as .trigger(): .triggerHandler('custom', ['arg1', 'arg2']). Extra values arrive after the event object in the handler.