JSFiddle - React, Tailwind, and code Playground

HTML

<input type='text'><br>
<input type='text'><br>
<button>
Check
</button>

JavaScript

$('button').click(function(){
  $('input').each(function(){ 
    alert($(this).val()); 
  });
});