<div id="theHover" class="therequest" style="display:none;">
<div class="noprint"><button id="closetheHover">Close Window</button></div>
All My Content
<div class="noprint"><button id="theprint" class="print">Print</button></div>
</div>
I want to close theHover div when clicked anywhere on the div except for on theprint button
I have the button closethehover closing it now.
$("#closetheHover").live("click", function(){
$("#theHover").hide();
});
I’d suggest:
JS Fiddle proof of concept.
Note that
live(). has been deprecated as of jQuery 1.7. If you’re using a version prior to 1.7, the API recommends usingdelegate(), or in 1.7 and above, useon().References:
:not()selector.on().