<input type="checkbox" name="Test1" onclick="SetAllCheckBoxes(this)"/> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> </br> <input type="checkbox" name="Test2" onclick="CheckBox(this)"/> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" /> <input type="checkbox" />
function SetAllCheckBoxes(obj) { var c = new Array(); c = document.getElementsByTagName('input'); for (var i = 0; i < c.length; i++) { if (c[i].type == 'checkbox') { c[i].checked = obj.checked; } } } function CheckBox(obja) { var d = new Array(); d = document.getElementsByTagName('input'); for (var i = 0; i < d.length; i++) { if (d[i].type == 'checkbox') { d[i].checked = obja.checked; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)