I’m basically trying to get the target element from event.target and if not equal process.
How can i get the below thing to work ?
$(document).ready(function(){
$(document).click(function(event) {
if(event.target!='#contents') { //If clicked element is not div #contents show alert .. //How can i achieve this ?
alert("..");
}
});
});
use
EDIT – if the structure is that of your comment use:
EDIT 2 – explanation of my code. If you have this markup
this code means