分享

全选功能

 yanjj 2011-11-30

<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>


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多