You could do this
$("#input").blur(function(){
if($(this).val() == ''){
alert('empty');
}
});
http://jsfiddle.net/jasongennaro/Y5P9k/1/
When the input has lost focus
that is .blur()
, then check the value of the #input
.
If it is empty == ''
then trigger the alert.