JQUERY1.9学习笔记 之基本过滤器(十一) 奇数选择器
奇数选择器
jQuery( ":odd" )
例:匹配表格的奇数行。
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <title>odd demo</title>
    <style>
        table {
            background: #f3f7f5;
        }
    </style>
    <script src="js/jquery-1.9.1.min.js"></script>
</head>
<body>
    <table border="1">
        <tr><td>Row with Index #0</td></tr>
        <tr><td>Row with Index #1</td></tr>
        <tr><td>Row with Index #2</td></tr>
        <tr><td>Row with Index #3</td></tr>
    </table>
   <script>
      $("tr:odd").css("background-color","#bbbbff");
   </script>
</body>
</html>

 
                    
                     
                    
                 
                    
                 
 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号