Javascript examples for jQuery:Mouse Event
check which element was clicked with event target
<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"> $(window).load(function(){// ww w .jav a 2 s. c o m $('*').on('click', function(e) { if(!$(e.target).is('input')){ console.log('clicked'); } }); }); </script> </head> <body> <input name="foo" type="text"> </body> </html>