Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
标签的“for”属性具有单选按钮的 ID。我可以隐藏单选按钮,但不能隐藏标签。我怎样才能隐藏标签。??
如果你使用 jQuery:
$('#radio_btn').hide(); $('label[for="radio_btn"]').hide();
或使用不同的标记:
HTML:
<label for="radio"><input type="radio" id="radio"> Radio</label>
JS:
$('label[for="radio"]').hide();