Check if a link was clicked - Javascript jQuery

Javascript examples for jQuery:Link

Description

Check if a link was clicked

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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from w ww  . j a va2s. co  m
$("a").filter(function() {
    return $(this).text() == 'See All';
}).click(function() {
    console.log('hello')
})
    });

      </script> 
 </head> 
 <body> 
  <a href="#">See All</a> 
  <a href="#">See All 2</a>  
 </body>
</html>

Related Tutorials