JSFiddle - React, Tailwind, and code Playground
HTML
<p>Логин</p> <input type="text">
<p>Пароль</p> <input type="text">
CSS
.highlight { background: #FA6; }
JavaScript
inputs = document.getElementsByTagName('input');
for (input in inputs) {
if (parseInt(input).toString() == 'NaN') continue;
inputs[input].onfocus = function() {this.className = 'highlight';};
inputs[input].onblur = function() {this.className = '';};
}