1

我有这个清单

<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中工作。

4

2 回答 2

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}
于 2012-07-13T01:54:13.510 回答
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();
于 2012-07-13T01:35:21.437 回答