我在 jsfiddle.net 上使用以下代码并且实时预览有效。运行我自己的本地副本,什么都没有...
复选框应在单选按钮单击时更改。
jsfiddle 预览:http: //jsfiddle.net/XqFDN/
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" ></script>
<script>
jQuery('#3day').click(function () {
jQuery('#mon , #tue , #wed').attr('checked', true);
});
jQuery('#2day , #1day').click(function () {
jQuery('#mon , #tue , #wed').attr('checked', false);
});
</script>
</head>
<body>
<form>
<input type="radio" name="passes" value="3day" id="3day" />3-Day
<input type="radio" name="passes" value="2day" id="2day" />2-Day
<input type="radio" name="passes" value="1day" id="1day" />1-Day
<br />
<input type="checkbox" name="mon" value="mon" id="mon" />Mon
<input type="checkbox" name="tue" value="tue" id="tue" />Tue
<input type="checkbox" name="wed" value="wed" id="wed" />Wed
<br />
</form>
</body>
</html>