JSFiddle - React, Tailwind, and code Playground

HTML

<button type="button">Click</button>
 <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">
  <input type="text">

CSS

.empty {
  border: 1px solid red;
}
button {
  display: block;
}

JavaScript

$('button').on('click', function() {
  $('input').filter(function(){
    return $(this).toggleClass('empty', !this.value)
  });
});