<html>
<head>
<script>
function choise(value)
{
var checkBoxs = document.getElementsByName("hobby");
for (var i = 0;i < checkBoxs.length ;i++ )
{
if(checkBoxs[i].type == "checkbox")
{
checkBoxs[i].checked = value;
}
}
}
</script>
</head>
<body>
<center>
<input name = "hobby1" type = "radio" checked>男
<input name = "hobby1" type = "radio">女
<input name = "hobby" type = "checkbox" onclick = "choise(this.checked)">全选<br>
<input name = "hobby" type = "checkbox" >打篮球
<input name = "hobby" type = "checkbox" >听音乐
<input name = "hobby" type = "checkbox" >看电影
</center>
</body>
</html>