glenelkins Posted July 30, 2009 Share Posted July 30, 2009 hi is there a way to detect when ANY element on the page is clicked rather than just a specific one so i can run a global resetting function thanks Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 30, 2009 Share Posted July 30, 2009 If you have firebug you can see what gets clicked in the console tab <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('html body *').click(function(){ console.log($(this)); }); }); </script> Quote Link to comment Share on other sites More sharing options...
glenelkins Posted July 30, 2009 Author Share Posted July 30, 2009 so basically you mean $('html body *') will detect any element? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 30, 2009 Share Posted July 30, 2009 any html element inside the body tag yes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.