• js判断checkbox的全选反选


     <script language="javascript" type="text/javascript">

            function selectAll(ctlName, bool) {
                var ctl = document.getElementById(ctlName);
                var checkbox = ctl.getElementsByTagName('input');

                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        checkbox[i].checked = bool;
                    }
                }
            }
            function hasselect() {
                var checkbox = document.getElementsByTagName('input');
                var haschecked = false;
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        if (checkbox[i].checked) {
                            haschecked = true;

                        }
                    }
                }

                if (!haschecked) {
                    alert('请选择订单!');
                    return false;
                }
            }
        </script>

  • 相关阅读:
    《将博客搬至CSDN》
    所谓找链表中点
    虚函数
    编辑距离
    数组移位
    DFA
    Single Number III
    XOR异或解惑
    First Bad Version
    while(!in.empty()) 和 while(in.size())
  • 原文地址:https://www.cnblogs.com/jimmychow/p/2251648.html
Copyright © 2020-2023  润新知