Finds even table rows : Selector table « jQuery « JavaScript DHTML






Finds even table rows

  

<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
                
            $("tr:even").css("background-color", "red");

                
        });
    </script>

  </head>
  <body>
    <body>
    <table border="1">
        <tr><td>TD #0</td><td>TD #1</td><td>TD #2</td></tr>
        <tr><td>TD #3</td><td>TD #4</td><td>TD #5</td></tr>
        <tr><td>TD #6</td><td>TD #7</td><td>TD #8</td></tr>
    </table>

    </body>
</html>

   
    
  








Related examples in the same category

1.Finds TD #1 and higher
2.Finds all table row containing "F"
3.Finds TDs less than the one with the second index
4.Finds all tds with children, including text.
5.Finds the last table row.