JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<input type="text" />
</div>
CSS
.parent {
height:100px;
width:200px;
border:2px solid red;
}
.parent.active {
border:2px solid #FF0;
}
JavaScript
$('input').on('focus', function () {
$(this).parent().addClass('active');
});