Easy Tutorial
❮ Jquery Css Jquery Animate ❯

jQuery event.isDefaultPrevented() Method

jQuery Event Methods

Example

Prevent the link from opening the URL and check if preventDefault() has been called:

$("a").click(function(event){
    event.preventDefault();
    alert("Checking if preventDefault() has been called: " + event.isDefaultPrevented());
});

Definition and Usage

The event.isDefaultPrevented() method checks if the preventDefault() method has been called on the specified event.


Syntax

Parameter Description
event Required. The event parameter comes from the event binding function.

jQuery Event Methods

❮ Jquery Css Jquery Animate ❯