Easy Tutorial
❮ Sel Input Text Event Change ❯

jQuery event.preventDefault() Method

jQuery Event Methods

Example

Prevent the link from opening the URL:

$("a").click(function(event){    event.preventDefault();    });

Definition and Usage

The event.preventDefault() method stops the default action of an element from happening.

For example:

Tip: Use the event.isDefaultPrevented() method to check whether the preventDefault() method was called on the specified event.


Syntax

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

jQuery Event Methods

❮ Sel Input Text Event Change ❯