The defaultPrevented event property is used for checking whether the preventDefault() method was called for the event or not.
The defaultPrevented event property returns true if the preventDefault() method was called for the event, else it returns false.
Below program illustrates the defaultPrevented event property :
Example-1: Checking if preventDefault() was called or not.
Beforer clicking the button:
After clicking the button:
- Internet Explorer
- Google Chrome
- Apple Safari
- HTML | bubbles Event Property
- HTML | isTrusted Event Property
- HTML | cancelable Event Property
- HTML | DOM cancelable Event Property
- HTML | DOM target Event Property
- HTML | view Event Property
- HTML | currentTarget Event Property
- HTML | DOM timeStamp Event Property
- HTML | returnValue Event Property
- HTML | DOM type Event Property
- jQuery | event.namespace Property
- jQuery | event.currentTarget Property
- jQuery | event.data Property
- jQuery | event.delegateTarget Property
- HTML | DOM onmousemove Event
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.