Disable any popup, When clicked on particular link - Javascript jQuery

Javascript examples for jQuery:Link

Description

Disable any popup, When clicked on particular link

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from w w  w . java2s  .  co  m*/
$("body").click(function(e) {
    if ($(e.target).hasClass('donot')) {
        return false;
    }
    console.log('d');
});
    });

      </script> 
 </head> 
 <body> 
  <div class="donot" style="width:200px; height:200px; border:1px solid red">
    donot 
  </div>  
 </body>
</html>

Related Tutorials