I have a div used for filtering and i want it to close when anything outside of the div is clicked. The selector I am trying to build, basically selects all elements except a specific element and excludes its children. Here is what ive tried, but havent been able to get working
$('*:not(:has(.exclude *))').live('click', function() {HideFilter();});
page structure is simplified to this:
<div></div>
<div>
<div></div>
<div>
<div class="exclude"><inputs></div>
</div>
<div></div>
</div>
so i want all of the divs, but the one and everything in the .exclude to have the event. Ive been at this for a while, i need some help.