Just started to learn jQuery, the first program from the book, and it does not work.
<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> .stripped { background-color: yellow; } .table { border: 1px solid black; border-collapse: collapse; } .table tr { border: 1px solid black; } </style> <script type="text/javascript"> $("table tr:nth-child(even)").addClass("stripped"); </script> </head> <body> <table class="table"> <tr><td>текст 1</td></tr> <tr><td>текст 2</td></tr> <tr><td>текст 3</td></tr> <tr><td>текст 4</td></tr> <tr><td>текст 5</td></tr> </table> </body> </html>
What's wrong with the code?