I am using jQuery to make a div hide if a different div is clicked:
js:
$("body").click(function(){
if( $(this).attr('class') == 'not-dropdown' ){
$(".dropdown").hide();
}
});
Before I tried this:
$("body").click(function(){
if( 1==1 ){
$(".dropdown").hide();
}
});
Then the div hid, but no matter where I clicked the div hid. How can I make the div only hide when it is a certain element that is clicked?
Fiddle