Summary

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).

Syntax

bool = event.defaultPrevented 

Example

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 18Edge Full support YesFirefox Full support 6IE Full support 9Opera Full support 11Safari Full support 5WebView Android Full support YesChrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 6Opera Android Full support 11Safari iOS Full support 5Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Tags: 
Last updated by: fscholz,