Javascript examples for jQuery:Mouse Event
Passing parameters in javascript onClick event using Jquery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w .j a v a2 s . c o m $("#click-sample").click(function(e){ console.log($(e.target).attr('some-data')); }); } </script> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <div id="click-sample" some-data="You got data inside Click"> Click Here </div> </body> </html>