[英]How to hide a label tag in javascript that has a certain value for the “for” attribute?
標簽的“ 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();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.