Reputation: 8990
If a field is empty when it is blurred (loses focus) I want to remove an image:
Here's the beginning code:
$('#type').keyup(function(){
$('#image').show();
$("#type").blur( function() {
// i wanted to check here if #type field is empty as well before hiding?
$('#image').hide();
});
Upvotes: 1
Views: 202
Reputation: 50109
$("#type").blur( function() {
if (this.value === '') {
$('#image').hide();
}
});
Upvotes: 4