这是 HTML:
<fieldset>
<legend>FieldsetName</legend>
<div></div>
</fieldset>
这是 CSS:
legend:focus {
background-color: #ffddbe;
outline: none;
}
legend.focusin {
background-color: #ffddbe;
outline: none;
}
点击它不会执行任何操作。
好吧,我想,我会选择 jQuery。
$('legend').focusin( function() {
$(this).addClass('focusin');
});
$('legend').focusout( function() {
$(this).removeClass('focusin');
});
这也无济于事。 但是,如果 $('legend') 监听“click”,它就会执行它应该执行的操作。给了什么?
最佳答案
关于jquery - <legend> 不会收到 :focus event?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24911321/