bianzhuo
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="button" value="全选" onclick="checkAll()">
    <input type="button" value="反选" onclick="reserveAll()">
    <input type="button" value="取消" onclick="cancleAll()">
    <table border="1">
        <thread>
            <th>选项</th>
            <th>姓名</th>
            <th>学号</th>
        </thread>
        <tbody>
            <tr>
                <td><input type="checkbox"></td>
                <td>大眼侠</td>
                <td>1001</td>
            </tr>
            <tr>
                <td><input type="checkbox"></td>
                <td>大眼侠</td>
                <td>1001</td>
            </tr>
            <tr>
                <td><input type="checkbox"></td>
                <td>大眼侠</td>
                <td>1001</td>
            </tr>
            <tr>
                <td><input type="checkbox"></td>
                <td>大眼侠</td>
                <td>1001</td>
            </tr>
            <tr>
                <td><input type="checkbox"></td>
                <td>大眼侠</td>
                <td>1001</td>
            </tr>
        </tbody>
    </table>
    <script src="jquery1.9.js"></script>
    <script>

        function checkAll() {
            $(":checkbox").prop("checked",true);
        }
        function  cancleAll() {
            $(":checkbox").prop(\'checked\',false);
        }
        function reserveAll() {
            $(":checkbox").each(function () {
                var v=$(this.checked)? false:true;
                $(this).prop(\'checked\',v);
            })
        }

    </script>
</body>
</html>

 

分类:

技术点:

相关文章:

  • 2021-12-15
  • 2022-01-13
  • 2021-11-01
  • 2021-11-01
  • 2021-11-11
  • 2021-12-15
  • 2021-11-01
  • 2021-12-05
猜你喜欢
  • 2021-09-09
  • 2021-12-15
  • 2021-11-01
  • 2021-05-10
  • 2021-12-05
  • 2021-12-15
相关资源
相似解决方案