JSFiddle - React, Tailwind, and code Playground

HTML

<table border="1">
        <tr><td> Index value 0</td></tr>
        <tr><td> Index value 1</td></tr>
        <tr><td> Index value 2</td></tr>
        <tr><td> Index value 3</td></tr>
        <tr><td> Index value 4</td></tr>
        <tr><td> Index value 5</td></tr>
        <tr><td> Index value 6</td></tr>
        </table>
        <button id="btn">Click to see the effect</button>

JavaScript

$('#btn').click(function(){ 
        $( "tr:odd" ).css( "background-color", "green" );
        });