JSFiddle - React, Tailwind, and code Playground

HTML

<input id="firstName" type="text" />
<input id="lastName" type="text" />
<a href="#" id="button">SEND</a>

CSS

.errorInput{
  border-color:red;
}

JavaScript

$('#button').click(function () {
    $('input').each(function(){
        var val = $(this).val();
        $(this).toggleClass("errorInput",val.length==0)
    })
});