【发布时间】:2014-07-23 13:07:14
【问题描述】:
这是 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 html css focus focusin