Returns a boolean indicating whether or not event.preventDefault()
was called on the event.
getPreventDefault()
method (see bug 691151).bool = event.defaultPrevented
if (e.defaultPrevented) { /* the default was prevented */ }
Specification | Status | Comment |
---|---|---|
DOM The definition of 'Event.defaultPrevented()' in that specification. | Living Standard |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 18 | Yes | 6 | 9 | 11 | 5 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 18 | Yes | 6 | 11 | 5 | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented