How do I check for a click on everything but a certain object?
I use (not), but I'm not sure how to call the class / id of the entire page.
$(".page").not("#divInfoBox").click(function (event) {
}
What's the correct way in the HTML code to specify page, as I have something like:
<html>
<body>
<div class="page">
</div>
</body>
</html>
What I see is this: Clicking on the top half of the page works; but the bottom of the page, where there is nothing but background color, the click does not register because it is "off the page" -- how do I extend this so the click works everywhere?
Thanks, Michael
Try this:
$("body:not('#divInfoBox')").click(function (event) {
});
Read the doc page for the not selector:
http://docs.jquery.com/Selectors/not
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With