Skip to content
Related Articles

Related Articles

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

How to stop default hashtag behavior with jQuery ?

Improve Article
Save Article
Like Article
  • Last Updated : 06 Apr, 2021

The event.isDefaultPrevented() method in jQuery is used to determine if this method has been called by an event handler that was triggered by this event. If event.preventDefault() method is called, the default action of the event will not be triggered.



Parameters: This method does not accept any parameter.

Return Value: This method returns undefined.



<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <script src=
    <a href="">
        default click action is prevented
    <div id="log"></div>
        $("a").click(function(event) {
                .append("default " 
                    + event.type + " prevented")


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!