Show number of clicks - Javascript jQuery

Javascript examples for jQuery:Mouse Event

Description

Show number of clicks

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-1.11.0.js"></script> 
      <script type="text/javascript">
    $(function(){//  w  ww .  j  a  va2 s .co m
$(function(){ 
   $("p").click(function(){
       $(this).html(+this.textContent + 1);
   });
});
    });

      </script> 
   </head> 
   <body> 
      <p>0</p>  
   </body>
</html>

Related Tutorials