<input type="checkbox" name="chkAll" id="chkAll" onclick="checkAll()" />全选
<br />
<input type="checkbox" name="chk1" id="chk1" />选项1
<br />
<input type="checkbox" name="chk2" id="chk2" />选项2
<br />
<input type="checkbox" name="chk3" id="chk3" />选项3
<br />
<script>
function checkAll()
{
for (var i = 1; i <=3; i++)
{
document.getElementById("chk"+i).checked = document.getElementById("chkAll").checked;
}
}
</script>
<br />
<input type="checkbox" name="chk1" id="chk1" />选项1
<br />
<input type="checkbox" name="chk2" id="chk2" />选项2
<br />
<input type="checkbox" name="chk3" id="chk3" />选项3
<br />
<script>
function checkAll()
{
for (var i = 1; i <=3; i++)
{
document.getElementById("chk"+i).checked = document.getElementById("chkAll").checked;
}
}
</script>
table=event.srcElement.parentNode.parentNode.parentNode.parentNode;
path="/NewDataSet/"+event.srcElement.parentNode.parentNode.parentNode.parentNode.id;
if(event.srcElement.checked)
{
for(var j=1;j<table.rows.length;j++)
table.rows[j].cells[table.rows[j].cells.length-1].children[0].checked=true;
}
else
{
for(var j=1;j<table.rows.length;j++)
table.rows[j].cells[table.rows[j].cells.length-1].children[0].checked=false;
}
function Ra_d()
{
var obj=document.all.checkbox1;
var obj1=document.all.checkbox1;
for(i=0;i <obj1.length;i++)
{
if(obj[0].checked)
{
obj1[i].checked=true;
}
}
}
</script>
</head>
<body>
<input type="radio" name="checkbox1" value="checkbox" onclick="Ra_d()"/>单选
<form id="form1" name="form1">
<input type="checkbox" name="checkbox1" value="checkbox" />双选
<input type="checkbox" name="checkbox1" value="checkbox" />双选
<input type="checkbox" name="checkbox1" value="checkbox" />双选
<input type="checkbox" name="checkbox1" value="checkbox" />双选
<input type="checkbox" name="checkbox1" value="checkbox" />双选
</form>
</body>
</html>
function selectAll ( ){
var aa=document.getElementById('aa');
var bb=document.getElementsByName('bb');
for( i=0;i<bb.length;i++){
bb[i].checked=aa.checked;
}
}
</script> <input type="checkbox" name="aa" onclick="selectAll();">全选<br>
<input type="checkbox" name="bb"><br>
<input type="checkbox" name="bb"><br>
<input type="checkbox" name="bb"><br>
<input type="checkbox" name="bb"><br>