我不能让下面的blur()函数工作:
$('.newselect').focus(function(){
$(this).parent().append('<div class="select_container"></div>');
});
$('.newselect').blur(function(){
$(this).parent().remove('.select_container');
});但是,如果我使用通用选择器$('*') (如下所示),它可以工作,为什么会这样?我如何解决这个问题?
$('.newselect').focus(function(){
$(this).parent().append('<div class="select_container"></div>');
});
$('.newselect').blur(function(){
$('*').remove('.select_container');
});发布于 2010-08-05 06:27:05
试试这个:
$('.newselect').focus(function(){
$(this).parent().append('<div class="select_container"></div>');
}).blur(function(){
$(this).siblings('.select_container').remove();
});https://stackoverflow.com/questions/3410279
复制相似问题