The creators of jQuery specifically created the library to make common tasks trivial. For example, designers will use JavaScript to “zebra-stripe” tables highlighting every other row in a table with a contrasting color—taking up to 10 lines of code or more.
Here’s how we accomplish it using jQuery:
$("table tr:nth-child(even)").addClass("striped");