JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<table>
<tr><th>Highlight Row</th></tr>
<tr><td>
<input type="checkbox" name="chkExample1" id="chkExample1" value="true" />
<label for="myExample1">Example 1</label>
<input type="text" name="txtExample1" id="txtExample1" class="required" />
</td></tr>
<tr><td>
<input type="checkbox" name="chkExample1" id="chkExample2" value="true" />
<label for="myExample1">Example 2</label>
<input type="text" name="txtExample2" id="txtExample2" class="evenRow" />
</td></tr>
</table>
</form>
CSS
th {
background: #005595;
color: white;
font-weight: bold;
}
.highlighted { background-color: yellow; }
JavaScript
$('input:checkbox').click(function() {
$(this).closest('td').toggleClass('highlighted',$(this).attr('checked'));
});