jQuery click event on blank space
jquery
Solution
This works in chrome. Haven't tried other browsers. Works off the idea that stickmangumby had:
$('body').click( function (e) {
if ( e.target == this )
alert('works');
});
Problem
I'm trying to catch an event when a user clicks a blank space on the page with jQuery. For example, lets say you have the following: ``` <html> <head> <title>Test</title> </head> <body> <p>Here's some text!</p> <body> </html> ``` I want to catch the event when the user clicks on anything but the p tag. Is there a way to catch something like this?