jquery全选效能
jquery全选功能input typecheckbox idc namec title全选/全不选 onclickselectAll(this.ch
jquery全选功能
- <input type="checkbox" id="c" name="c" title="全选/全不选" onclick="selectAll(this.checked,'list')" /> <input type="checkbox" name="list" />
- <input type="checkbox" name="list" /> <input type="checkbox" name="list" />
- <input type="checkbox" name="list" /> <input type="checkbox" name="list" />
- <input type="checkbox" name="list" /> <a href="javascript:void(0)" onclick="selectAll(true,'list')">全选</a> - <a href="javascript:void(0)" onclick="selectAll(false,'list')">全不选</a>
?
?
- function selectAll(flag, checkBoxName) { $("input:checkbox[name='" + checkBoxName + "']").each(function () {
- $(this).attr("checked", flag); });
- }