event.isDefaultPrevented() returns a Boolean: true if event.preventDefault() was called on this event, otherwise false. Added in jQuery 1.3. Takes no arguments.
Remember
event.isDefaultPrevented() // Boolean — no arguments
// Official idea
$("a").on("click", function (event) {
event.isDefaultPrevented(); // false
event.preventDefault();
event.isDefaultPrevented(); // true
});
// Pair with: preventDefault() to cancel
// Not the same as: isPropagationStopped() (bubbling flag)
Call it on the event object before or after preventDefault().
Bind a handler with .on() and accept event.
Optionally read event.isDefaultPrevented() early (usually false).
Call event.preventDefault() when you need to cancel the default.
Call event.isDefaultPrevented() again — now true.
In a later handler on the same event, branch if the default was already cancelled.
Piece
Required?
Role
event
Yes
jQuery event object in the handler
preventDefault()
To cancel
Sets the flag this method reads
isDefaultPrevented()
—
Returns true / false
Arguments
None
Method takes no parameters
Pseudocode
Pseudocode
element.on("click", handler)
when event fires:
flag = false
call handler(event):
event.isDefaultPrevented() → flag // usually false first
if need to cancel:
event.preventDefault()
flag = true
event.isDefaultPrevented() → flag // true after prevent
// Later handler on same event:
if event.isDefaultPrevented():
skip fallback default logic
else:
maybe allow or prevent yourself
Reference
Cheat Sheet
Keep these facts handy while coordinating handlers.
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official: False, Then True
Check the flag before and after preventDefault() on a link.
jQuery
$("a").on("click", function (event) {
var before = event.isDefaultPrevented();
event.preventDefault();
var after = event.isDefaultPrevented();
$("#out").text(
"Before: " + before + "\\nAfter: " + after
);
});
event.isDefaultPrevented() is a jQuery event-object method available since 1.3. It mirrors the idea of the native defaultPrevented property on a normalized event. Works wherever your loaded jQuery version runs.
✓ Stable · jQuery 1.3+
isDefaultPrevented()
Supported in jQuery 1.3–3.x. Prefer jQuery 3.x with .on() handlers. Native equivalent: event.defaultPrevented (boolean property).
100%With jQuery 1.3+
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
isDefaultPreventedjQuery 1.3+
Bottom line: Safe for production. Call preventDefault() to cancel; call isDefaultPrevented() to ask whether it already happened.
Analysis
Performance Notes
Approach
Cost
Best for
event.isDefaultPrevented()
Free
Reading a boolean flag
event.preventDefault()
Cheap
Cancelling navigation / submit
Many handlers checking the flag
Cheap
Coordinating plugin + app handlers
The method is a simple flag read. Use it when coordination matters — not on every single handler by habit.
Remember
Key Takeaways
Role: ask whether preventDefault() already ran.
Returns:false then true after prevent (official demo).
Coordinate: later handlers can skip fallback defaults.
Not bubbling: use isPropagationStopped() for that flag.
One line:isDefaultPrevented() answers “did someone already cancel the default?”
Frequently Asked Questions
It returns true if event.preventDefault() was called on this event object during handler execution, and false otherwise. It takes no arguments. Available since jQuery 1.3.
When multiple handlers run on the same event and a later one needs to know whether an earlier handler already cancelled the default action — for example, skipping fallback navigation after a link was prevented.
In jQuery handlers, return false calls both preventDefault() and stopPropagation(). After return false, isDefaultPrevented() returns true. Prefer explicit event.preventDefault() for clarity.
Same idea. Native events expose a defaultPrevented boolean. jQuery provides isDefaultPrevented() as a method on its normalized event object for a consistent API.
No. isDefaultPrevented() only reports state. Once preventDefault() runs, the default action stays cancelled for that event dispatch.
isDefaultPrevented() reports whether the browser default was cancelled (link navigation, form submit). isPropagationStopped() reports whether bubbling was stopped. Different flags.