JSFiddle - React, Tailwind, and code Playground

HTML

<form>
  <input type="text" id="text1">
  <br>
  <input type="text" id="text2">
  <br>
  <button type="button">Send</button>
</form>

JavaScript

$('button').click(function() {
	var txt1 = $(this).siblings('#text1').val();
  var txt2 = $(this).siblings('#text2').val();
  if (txt1.length && txt2.length) {
  	alert("OK");
  } else alert("Not OK");
});