jquery 表格操作

jquery 表格操作
<title></title>
    <script src="jquery-1.8.3.js"></script>
    <script>
        $(function () {
            $(#tb tr:eq(0)).css({ "background-color": "gray", "height": "60px" });
            $(#tb tr:not(:eq(0)):odd).css("background-color", "yellow");
            $(#tb tr:not(:eq(0)):even).css("background-color", "green");
            var bg;
            $(#tb tr:not(:eq(0))).hover(function () {
                bg = $(this).css("background-color");

                $(this).css("background-color", "red");
            }, function () {
                    $(this).css("background-color", bg);
            })
        })

    </script>
</head>
<body>
    <table border="1" id="tb">
        <tr>
            <th>adfafa</th>
            <th>adfadf</th>
            <th>adfadf</th>
            <th>adfadf</th>
            <th>adfadf</th>
            <th>adfadf</th>
        </tr>
        <tr>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
        </tr>
        <tr>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
        </tr>
        <tr>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
        </tr>
        <tr>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
        </tr>
        <tr>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
            <td>a</td>
        </tr>

    </table>
</body>
</html>
jquery 表格操作

 

jquery 表格操作,布布扣,bubuko.com

jquery 表格操作

上一篇:网站安全(20) —— 语义URL攻击


下一篇:Apache配置多个网站的方法