jQuery + Not Selector
- by Andrej
Being a newbie to Javascript and jQuery, I am not sure whether this is not possible at all or I am just doing a completely dumb mistake:
I am trying to hide a div on any click outside the div itself.
I have simplified the code for demonstration purpose:
HTML
<html>
<div class="tooltip">
Bla Bla Bla
</div>
</html>
jQuery
$('html:not(.tooltip)').click(function() {
$('.tooltip').hide();
});
Demo
http://jsfiddle.net/yCx6F/1/