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();
});
If you wanted to avoid adding the flag variable, you could use jQuery’s .data to store the flag value against e.g. the
div.stopelement, e.g:EDIT
If you want to allow for the situation where the text box has focus, and you then click on
div.stop, and you don’t want it to hide, then you could try something like: