如果字段在模糊(失去焦点)时为空,我想删除图像:
这是开始代码:
$('#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();
}
});
关于jquery - 检查 jquery(js) 中的字段是否为空?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4179031/