我有这个清单
<li id="field_7_div" class="field_block">
<div class="col_label">
<label class="form_field">How satisfied are you with <span class="aggregator_name">your aggregator</span>?</label>
<label class="form_required">*</label>
</div>
<div class="col_field">
<div class="radio" id="uniform-field_7_0"><span>
<input type="radio" class="form_radio" value="Very Satisfied" id="field_7_0" name="field_7" style="opacity: 0;">
</span></div>
<label for="field_7_0" class="form_choice_text">Very Satisfied</label>
<br>
<div class="radio" id="uniform-field_7_1"><span>
<input type="radio" class="form_radio" value="Satisfied" id="field_7_1" name="field_7" style="opacity: 0;">
</span></div>
<label for="field_7_1" class="form_choice_text">Satisfied</label>
<br>
<div class="radio" id="uniform-field_7_2"><span>
<input type="radio" class="form_radio" value="Neutral" id="field_7_2" name="field_7" style="opacity: 0;">
</span></div>
<label for="field_7_2" class="form_choice_text">Neutral</label>
<br>
<div class="radio" id="uniform-field_7_3"><span>
<input type="radio" class="form_radio" value="Unsatisfied" id="field_7_3" name="field_7" style="opacity: 0;">
</span></div>
<label for="field_7_3" class="form_choice_text">Unsatisfied</label>
<br>
<div class="radio" id="uniform-field_7_4"><span class="checked">
<input type="radio" class="form_radio" value="Very Unsatisfied" id="field_7_4" name="field_7" style="opacity: 0;">
</span></div>
<label for="field_7_4" class="form_choice_text">Very Unsatisfied</label>
<br>
<input type="hidden" value="5" name="field_7_length">
<div class="instruction" id="field_7_tip"></div>
</div>
</li>
我想隐藏文字“满意,中立,不满意”,只留下“非常满意和非常不满意”。你能告诉我如何使用Jquery隐藏这个文本吗?或CSS,如果它适用于 IE8 。
答案 0 :(得分:3)
仅限CSS
#uniform-field_7_1 + label,
#uniform-field_7_2 + label,
#uniform-field_7_3 + label{display:none}
label[for="field_7_1"],
label[for="field_7_2"],
label[for="field_7_3"]{display:none}
答案 1 :(得分:1)
如果ids永远不会改变,你可以用CSS隐藏
#uniform-field_7_1, #uniform-field_7_2,
#uniform-field_7_3 { display: none !important; }
和标签使用jquery
$('label[for*="field_7_1"], label[for*="field_7_2"], label[for*="field_7_3"]').hide();