How to use isDefaultprevented() Method event in jQuery

This article describe about isDefaultprevented() Method in jQuery.
  • 3417

jQuery Event isDefaultPrevented() Method

Weather or not the preventDefault() method is called for the specified event object, it return by the isDefaultPrevented() method.




Parameter Description
event Required. It define to check. The event parameter comes to the event bind method


<!DOCTYPE html>



<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $("a").click(function (event) {


            alert("Default prevented: " + event.isDefaultPrevented());






<a href="/">Go to</a>

<p>The preventDefault() method will prevent the link above from the URL.</p>

<p>Click on link and check if the default action is prevented.</p>






isDefaultprevent method pic 16.jpg

Note: After click on the link.


IsDefaultprevent pic17.jpg


You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.