I simply want to hide a div, if a text box loses focus, unless, the user clicks in another certain div. If user clicks that particular div, then the focusout doesn't trigger the div.box being hidden.
Below is code with my pseudocode commenting. Any ideas?
textInput.focusout(function() {
// So long you didn't click div.stop, then
$('div.box').hide();
});
$(document).bind('click',function(e) {
if ($(e.target).closest('div.box').length) return;
$('div.box').hide();
});
Try this!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With