let say i want to bind all items that are under
#mainDiv .user
Except
#mainDiv #exception .user
I can think of
$('#mainDiv .user').bind('event',function(){
if($(this).parents('#exception').length>0){}else{
// do stuff;
}
});
or:
$('#mainDiv :not('#exception').find('.user').bind('event',function(){
if($(this).parents('#exception').length>0){}else{
// do stuff;
}
});
Whats a better one?