我一直在为使用三态 jquery 插件的客户端工作,经过大量调试后,我发现隐藏的输入没有显示:
<ul>
<li>
<a href="#" class="checkbox checked">undefined</a>
<input type="checkbox" style="display: none; " />
<label for="england" class="checkbox">England</label>
<span class="toggler opened"> </span>
<ul style="display: block; ">
<li class="city">
<a href="#" class="checkbox checked">undefined</a>
<input type="checkbox" value="leeds" id="cb_leeds" style="display: none; " />
<label for="cb_leeds" class="checkbox" >Leeds</label>
</li>
<li class="city">
<a href="#" class="checkbox checked">undefined</a>
<input type="checkbox" value="london" id="cb_london" style="display: none; " />
<label for="cb_london" class="checkbox checked" >London</label>
</li>
</ul>
</li>
</ul>
我发现在他们使用的插件中,他们的脚本中有这个:
$('#pf-locations .city input:checked').each(function() {
cities.push($(this).val());
});
有谁知道我怎样才能让插件检查隐藏的输入?谢谢!