jquery even selector
Translation results:
even
英[ˈi:vn] 美[ˈivən]
adv.Even; even; even; more; coincidentally at...time
adj. Fair; flat; even; average
vt. Make flat; make equal
vi. Flatten; become equal
jquery even selectorsyntax
Function::The even selector selects every element with an even index value (such as 2, 4, 6). Index values start at 0, and all first elements are even numbers (0). The most common usage: Used with other elements/selectors to select even-numbered elements in a specified group (such as the example above).
Syntax: $(":even")
Notes: Please use the :odd selector to select odd-numbered elements .
jquery even selectorexample
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("tr:even").css("background-color","#B2E0FF"); }); </script> </head> <body> <html> <body> <h1>Welcome to My Web Page</h1> <table> <tr> <th>Id</th> <th>LastName</th> <th>FirstName</th> <th>Address</th> <th>City</th> </tr> <tr> <td>1</td> <td>Adams</td> <td>John</td> <td>Oxford Street</td> <td>London</td> </tr> <tr> <td>2</td> <td>Bush</td> <td>George</td> <td>Fifth Avenue</td> <td>New York </td> </tr> <tr> <td>3</td> <td>Carter</td> <td>Thomas</td> <td>Changan Street</td> <td>Beijing</td> </tr> <tr> <td>4</td> <td>Obama</td> <td>Barack</td> <td>Pennsylvania Avenue</td> <td>Washington</td> </tr> </table> </body> </html> </body> </html>
Click the "Run instance" button to view the online instance
Popular Recommendations
- You Could Be Sitting on a Fortune You Didn't Even Know About
- Rare coins can be a hidden treasure, potentially worth hundreds or even thousands
- Huawei's first tri-foldable surpasses 1.7 million reservations even before its official launch
- VSCode extensions are not removed from file system even after uninstalling, I created a solution !
- Samsung Galaxy S25 revealed to be keeping compact flagship form factor with even thinner bezels
- Unity cancels \'Runtime Fee\' before controversial pricing structure even goes into effect in Unity 6