全选,全不选,反选.等等等等
[code="js"]
全 选
反 选
Item1
Item2
Item3
Item4
Item5
[/code] [code="js"] 全选 反选
篮球
旅游
读书
美食
睡觉 [/code] [code="js"]
全 选
反 选
Item1
Item2
Item3
Item4
Item5
[/code] [code="js"]var checkFlag = true; function ChooseAll() { if (checkFlag) { var inputs = document.all.tags("INPUT"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == "checkbox" && inputs[i].id != "CheckAll") { inputs[i].checked = true; } } checkFlag = false; } else { var inputs = document.all.tags("INPUT"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == "checkbox" && inputs[i].id != "CheckAll") { inputs[i].checked = false; } } checkFlag = true; } }[/code] [code="js"] 测试测试
[/code]