JSFiddle - React, Tailwind, and code Playground
HTML
<table id="table">
<tr><td><input type="radio" name="sth" value="1">1</td><td>another td</td></tr>
<tr><td><input type="radio" name="sth" value="2">2</td><td>another td</td></tr>
</table>
CSS
.newclass {
background-color: #ffff00;
}
JavaScript
all_tds = $('#table td');
$(function () {
$('input:radio').on('change', function () {
all_tds.removeClass("newclass");
if (this.checked) {
$(this).parent().siblings("td").addClass("newclass");
}
});
});