8月232014
js全选checkbox
- js全选checkbox
- <input type="checkbox" name="selectall" value=on onclick="selectAll()">
- <script>
- function selectAll(form) {
- var obj = document.getElementsByName('selectall');
- var cks = document.getElementsByTagName("input");
- var ckslen = cks.length;
- for(var i=0;i<ckslen-1;i++) {
- if(cks[i].type == 'checkbox') {
- cks[i].checked = obj[0].checked;
- }
- }
- }
- </script>
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!