JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" maxlength="6" id="check" data-minlength="6" /><br />
<input type="submit" value="send" />
JavaScript
$(function() {
$('input[type="submit"]').prop('disabled', true);
$('#check').on('input', function(e) {
if(this.value.length === 6) {
$('input[type="submit"]').prop('disabled', false);
} else {
$('input[type="submit"]').prop('disabled', true);
}
});
});