Set variable equal to this value on click - Javascript jQuery

Javascript examples for jQuery:Mouse Event

Description

Set variable equal to this value on click

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.6.4.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from   w ww  .j  a v  a 2  s. c  om
$(".delete_link").click(function(){
    var deleteID = $(this).attr("value");
    console.log(deleteID);
});
    });

      </script> 
 </head> 
 <body> 
  <a href="#?id=1" value="1" class="delete_link">Click to delete this row</a>  
 </body>
</html>

Related Tutorials