JSFiddle - React, Tailwind, and code Playground
HTML
<table id="mytable" class="table-striped">
<tbody>
<tr><td>blah blah blah blah</td></tr>
<tr><td>clicking this row will turn it red</td></tr>
<tr><td>but click this row, and it will stay green</td></tr>
<tr><td>blah blah blah blah</td></tr>
<tr><td>blah blah blah blah</td></tr>
</tbody>
</table>
CSS
.table-striped tbody tr:nth-child(odd) td {
background-color: green;
}
.highlight {
background-color: red;
}
JavaScript
$('#mytable tbody tr').live('click', function(event) {
$clicked_tr = $(this);
$clicked_tr.parent().children().each(function() {
$(this).removeClass('highlight')
});
$clicked_tr.addClass('highlight');
});