Reputation: 13721
I am having some issues with focusout. I want an alert when an input box is selected and I click out of the inputbox. However, after I click it and click out of it, I do not get an alert. Here is my code:
<script>
$(document).ready(function(){
$("#val1").focusout(function(){
alert('focusout');
});
});
</script>
<p><label>Value: </label><input id="val1" type="text" placeholder="example: val"></p>
Any ideas? Thanks!
Upvotes: 3
Views: 8494
Reputation: 173
.focusout() only works when you click on another focusable element. The problem, which I'm trying to sort through as well, is what happens when you click right outside of the input box. The input no longer has focus, but the focusout event is not triggered.
I would appreciate anyone's thoughts on this!!
Upvotes: 6