JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td>Name</td><td><input type="text" name="name"></td>
</tr>
<tr>
<td>Mail</td><td><input type="text" name="name"></td>
</tr>
</table>
CSS
tr.highlight{
background-color:yellow;
}
JavaScript
$("tr > td > input").focus(function(e){
$(this).parent().parent().addClass('highlight');
}).blur(function(e){
$(this).parent().parent().removeClass('highlight');
});