In the code below if you click on <input type="text" id="one" />
and a "red block" appears. If you focus out then the "red block" disappears.
How do I make it so that focusout
wont fire if "red block" or <input type="text" id="two" />
are the next focused elements?
JavaScript
$('#one').focus(function () {
$('#divRemove').show();
});
$('#one').focusout(function () {
$('#divRemove').hide();
});
$('#divRemove').click(function(){
alert($(this).text());
});
HTML
<input type="text" id="one" />_______
<input type="text" id="two" />
<br/>
<br/>
<div id="divRemove" style="width:100px;height:100px;background:red; display:none;">remove on focus out</div>