MDN wants to learn about developers like you:


Returns a boolean indicating whether or not event.preventDefault() was called on the event.

Note: You should use this instead of the non-standard, deprecated getPreventDefault() method (see bug 691151).


bool = event.defaultPrevented 


 if (e.defaultPrevented) {
   /* the default was prevented */


Specification Status Comment
The definition of 'Event.defaultPrevented()' in that specification.
Living Standard  

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 18 (Yes) 6.0 (6.0) 9.0 11.0 5.0
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) 6.0 (6.0) ? ? 5.0

Document Tags and Contributors

 Last updated by: DomenicDenicola,