does anyone know if css position:relative; can mess up the function
$('body').not($('.theDIV')).click(function(){
alert('');
});
or the problem is somewhere else?
what is happening is i have a that appears on click of a button and i want it to hide() when i click anywhere on the body, except the div itself. HTML
<ul class='messages'> //these are made dynamically. should i use each() to go through all the elements?
<li>
<div class='theDIV'></div>
<input type='button'>
</li>
<li>
<div class='theDIV'></div>
<input type='button'>
</li>
<li>
<div class='theDIV'></div>
<input type='button'>
</li>
</ul>
sorry if i wasnt clear the first time