checking if a field is empty in jquery(js)?
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();
});
$("#type").blur( function() {
if (this.value === '') {
$('#image').hide();
}
});
精彩评论