event.isDefaultPrevented()

event.isDefaultPrevented()

event.isDefaultPrevented()Returns: Boolean

Description: Returns whether event.preventDefault() was ever called on this event object.

Example:

Checks whether event.preventDefault() was called.

$( "a" ).click(function( event ) {
  alert( event.isDefaultPrevented() ); // false
  event.preventDefault();
  alert( event.isDefaultPrevented() ); // true
});

© The jQuery Foundation and other contributors
Licensed under the MIT License.
https://api.jquery.com/event.isDefaultPrevented

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部