这是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”,它会做它应该做的事情。是什么赋予了?