Javascript examples for jQuery:Mouse Event
Add click and hover in same function
<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(){/*from ww w .j a v a 2 s. c o m*/ $('.img').hover(function (event) { console.log(event) }).on("click", function (event) { console.log(event) }); }); </script> </head> <body> <span class="img">span</span> </body> </html>