JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" placeholder="Enter your name...">
<button>Submit</button>
JavaScript
$(document).ready(function() {
$('button').attr('disabled', 'disabled');
$('input[type=text]').on('input', function() {
if ($(this).val() !== '') {
$('button').removeAttr("disabled");
} else {
$('button').attr('disabled', 'disabled');
}
});
});