html - jquery not in a child div (can I use find?) -
i trying select whole div not specific div inside main div. example follows: <div id="main_holder"> <div id="secondholder"> <div id="thirdholder"> <div id="dividonotwanttouse" class="notused"></div> </div> </div> </div> i trying simple click see when click on div, shouldn't alert. $('#main_holder').not('#main_holder.notused').click( function(event) { alert( 'pullmenu clicked' ); }); it's not working, best approach? there way use find in not selector? example works: $('#main_holder').find('#dividonotwanttouse').css({ border: '5px solid red' }); solution arun: $('#main_holder').click( function(event) { if(!$(event.target).closest('.notused').length) { alert( 'pullmenu clicked' ); } }); try $('#main_holder').click( function(e...