the noob way to do it I guess would be
$('*').click(function(){...});
But is there any way I can catch any type of click, without having to register a listener for every object in the DOM?
Help would be amazing. =)
A click
event will by default bubble up the DOM, so you can just attach a click
handler to the root, like this:
$(document).click(function() {
//do something
});
Unless a handler on an element along the way does an event.stopPropagation()
or return false
, you'll get the click here.