我有一个简单的表格:jQuery的事件()
<div class="class_a">
<fieldset>
<label><input type="radio" id="radio10" name="color" value="1" />Red</label><br />
<label><input type="radio" name="color" value="2" />Yellow</label><br />
<label><input type="radio" name="color" value="3" />Blue</label><br />
<label><input type="radio" name="color" value="4" />Purple</label><br />
</fieldset>
</div>
<div class="block-cms">
<fieldset>
<label><input type="radio" name="time" value="6" />12</label><br />
<label><input type="radio" name="time" value="7" />11</label><br />
<label><input type="radio" name="time" value="8" />10</label><br />
<label><input type="radio" name="time" value="9" />9</label><br />
</fieldset>
</div>
什么即时试图在这里做的是通过使用jQuery的变化()隐藏掉第二个字段集。
$("input#radio10").change(function() {
var checked = true;
checked = checked && $(this).is(':checked');
if ($('input#radio10:checked')) {
$('.block-cms').show()
}
else {
$('.block-cms').hide();
}
});
不确定这里有什么问题。任何人都可以建议我应该做什么不同请吗?
对不起,那是简单的拼写错误。但仍然不起作用。 – Dom 2010-11-10 10:10:32
@Dom - 检查演示,是不是你在之后,只显示红色被选中? – 2010-11-10 10:11:45
谢谢! – Dom 2010-11-10 10:13:31