event.result stores the last non-undefined return value from a handler that ran earlier during the same event dispatch on the same element. This tutorial covers the official two-handler click demo, validation chains, undefined guard behavior, custom event pipelines, and comparing with event.data and $.trigger.
01
Property
event.result
02
Returns
Object (any)
03
Official
return “hey”
04
Chain
Prior handler output
05
undefined
Does not overwrite
06
Since 1.3
All event types
Fundamentals
Introduction
When multiple handlers are bound to the same element and event, jQuery runs them in registration order during one dispatch. Each handler can return a value — and jQuery exposes the most recent non-undefined return to later handlers as event.result.
Unlike event.data (bind-time payload) or the second argument to $.trigger() (trigger-time payload), event.result captures what an earlier handler returned during execution. jQuery has forwarded it since version 1.3 — especially useful for custom events and handler chains on the same element.
Concept
Understanding event.result
This property answers one question: what did the previous handler in this dispatch return?
Same dispatch — only handlers on the same element, same event, same trigger count.
Last non-undefined — returning undefined (or nothing) does not replace an earlier result.
Read-only — a property on the event object; not a method.
Any type — strings, numbers, objects, or false to signal cancellation in some patterns.
💡
Beginner Tip
In the official jQuery demo, the first click handler return "hey" and the second reads event.result to fill a paragraph — no shared variables or closures needed.
📋 event.result vs handler return vs event.data vs $.trigger
Four ways data moves through jQuery events — each channel serves a different purpose.
event.result
event.result
Prior handler return (same dispatch)
Handler return
return "value";
Sets result for next handler
event.data
.on("click", { id: 1 }, fn)
Bind-time payload object
$.trigger arg
.trigger("evt", [data])
Trigger-time extra arguments
Hands-On
Examples Gallery
Example 1 follows the official jQuery click demo. Examples 2–5 cover validation chains, undefined guard behavior, custom event pipelines, and a four-way comparison with event.data.
📚 Official jQuery Demo
Two click handlers on one button — first returns a string, second displays event.result.
Example 1 — Official Demo: display previous handler’s return
Official jQuery demo — first handler returns "hey", second sets paragraph HTML from event.result.
event.data.source: bind
event.result: from-return
(trigger arg is separate from event.result)
How It Works
event.data comes from .on() binding; event.result from an earlier handler’s return; $.trigger(…, [data]) passes trigger-time args — three independent channels.
Custom event hooks — plugins return status objects for downstream handlers.
Multi-step widgets — accumulate computed values across handlers on one element.
Cancel patterns — early handler returns false; later handlers inspect result.
Testing triggers — simulate handler chains without shared globals.
Legacy plugin APIs — read previous plugin return on the same dispatch.
🧠 How event.result Works
1
Event dispatch starts
User click or .trigger() runs all handlers bound to the element in registration order.
Dispatch
2
First handler returns
If the return value is not undefined, jQuery stores it on event.result.
Return
3
Later handlers read result
Each subsequent handler sees the latest non-undefined return via event.result.
Read
4
✓
Handler chain complete
Validation messages, plugin status, or official demo text — passed forward without closures or globals.
Important
📝 Notes
Available since jQuery 1.3 — returns an Object (any non-undefined return type).
Read-only property — set indirectly by prior handler returns during dispatch.
Only the last non-undefined return is stored — not every handler’s return history.
Returning undefined (or nothing) does not overwrite a previous result.
Scoped to the same element and event on one dispatch — not cross-element.
Not the same as event.data or $.trigger() second argument — see Compare section.
Compatibility
Browser Support
event.result is a jQuery event object property since jQuery 1.3+. It is implemented entirely in jQuery’s event dispatch — not a native DOM property — and works consistently in all browsers jQuery supports.
✓ jQuery 1.3+ · all browsers
jQuery event.result
Last non-undefined handler return on the same dispatch.
100%Universal
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
resultObject (any)
Bottom line: Read event.result in later handlers — prior non-undefined return from the same dispatch.
Wrap Up
Conclusion
event.result exposes the last non-undefined return from an earlier handler on the same dispatch — the official demo passes "hey" from the first click handler to the second via this property.
Use it for validation chains, custom event pipelines, and plugin hooks — and always distinguish it from bind-time event.data and trigger-time $.trigger arguments.
Return meaningful values from early handlers in a chain
Use for custom events and plugin pipelines on one element
Return false explicitly when you mean to signal cancel
Document handler order when relying on event.result
❌ Don’t
Call event.result() with parentheses
Expect result from handlers on a different element
Confuse event.result with event.data
Assume every handler return is stored — only last non-undefined
Assign to event.result directly — it is set by jQuery
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about result
Prior handler return on the same dispatch.
5
Core concepts
R01
result
Last non-undefined return
API
hey02
Official
Two-handler demo
Demo
∅03
undefined
Does not overwrite
Guard
data04
event.data
Bind-time payload
Compare
evt05
Custom
Plugin pipelines
Pattern
❓ Frequently Asked Questions
event.result is a property on the jQuery event object. It holds the last non-undefined value returned by a handler that ran earlier during the same event dispatch on the same element. Available since jQuery 1.3.
Each handler can return a value, but only the most recent non-undefined return is stored on event.result for later handlers in the chain. The second handler does not receive the first handler's return directly — it reads event.result.
The official API example binds two click handlers on a button. The first returns the string "hey". The second sets a paragraph's HTML to event.result — displaying hey.
No. jQuery only updates event.result when a handler returns a value that is not undefined. A middle handler that returns undefined leaves the previous result intact for subsequent handlers.
Yes. When you .trigger() a custom event, handlers bound with .on() run in order and can pass data forward via return values. Later handlers read the accumulated value from event.result — useful for plugin pipelines.
No. event.data is the object passed at bind time with .on('click', { id: 1 }, fn). event.result is the return value from an earlier handler during dispatch. $.trigger('evt', [payload]) supplies trigger-time data — a third, separate channel.
Did you know?
The official jQuery event.result demo uses two click handlers on the same button — the first return "hey" and the second reads event.result to set paragraph HTML, proving handler return values flow forward without shared variables.