Switching between selecting all and not selecting all
ps: (Of course, if the select all box is another control such as a button, or a link, then check The checkItem click event in the box can be removed to avoid errors) <script> <BR>function checkAll(e, itemName) <BR>{ <BR> var aa = document.getElementsByName(itemName); <BR> for (var i=0; i<aa.length; i++) <BR> aa[i].checked = e.checked; <BR>} <BR>function checkItem(e, allName) <BR>{ <BR> var all = document.getElementsByName(allName)[0]; <BR> if(!e.checked) all.checked = false; <BR> else <BR> { <BR> var aa = document.getElementsByName(e.name); <BR> for (var i=0; i<aa.length; i++) <BR> if(!aa[i].checked) return; <BR> all.checked = true; <BR> } <BR>} <BR></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn