标签:
window.onload = function () {
var oChs = document.getElementsByClassName("ck");
var ach = document.getElementById(‘ck1‘);
ach.onclick = function ()
{
if (ach.checked)
{
for (var i = 0; i < oChs.length; i++)
{
oChs[i].checked = 1;
}
}
else
{
for (var j = 0; j < oChs.length; j++) {
oChs[j].checked =false;
}
}
}
for (var i = 0; i < oChs.length; i++) {
oChs[i].onclick = function ()
{
if (this.checked == 0)
{
ach.checked = 0;
}
}
}
}
标签:
原文地址:http://www.cnblogs.com/wswbk/p/4822372.html