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

var i;
var inputs = document.querySelectorAll("tr > td > input");
for(i = 0; i < inputs.length; ++i){
    inputs[i].addEventListener('focus',function(e){
        this.parentNode.parentNode.className += ' highlight';        
    });
    inputs[i].addEventListener('blur',function(e){
        this.parentNode.parentNode.className = this.parentNode.parentNode.className.replace(/\s*highlight\s*/ig,' ');
    });
}