Im trying to detect when a user clicked on the document, so:
$(document).click(function(e){ ...
When they do click on the document I wanna check if the document was clicked outside a div (including all contents inside the div)
Currently it works so that if I click outside the div it does what I want, but if I click an element inside the div it fires the outside of div event
$(document).click(function(e) {
var target = e.target;
if (!$(target).hasClass('classHere') {
//do stuff
}
}