English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery event.isDefaultPrevented() method

jQuery Effect Methods

The method event.isDefaultPrevented() checks whether the specified event has had the default action preventedevent.preventDefault().

如果调用event.preventDefault(),则此方法返回true;否则,返回false。

If event.preventDefault() is called, this method returns true; otherwise, it returns false.

This method does not accept any parameters.

Syntax:

event.isDefaultPrevented()

Example

Prevent the link from opening the URL and check if preventDefault() has been called:
  $("#submit").click(function(event){
  $("a").click(function(event){
event.isDefaultPrevented());
});/Test and see‹

$("div").text(event.isDefaultPrevented());

Example
  $("#submit").click(function(event){
  event.preventDefault(); + alert("Prevented: "
event.isDefaultPrevented());
});/Test and see‹

Parameter ValueParameter
DescriptioneventThisEvent

jQuery Effect Methods