JSFiddle - React, Tailwind, and code Playground
HTML
<form onsubmit="return fun()" method="post" action="#">
<input type="text" id="uname" name="username">
<button>Sign in</button>
</form>
JavaScript
function fun() {
input_field_value = document.getElementById('uname').value;
if (input_field_value.length > 1) {
return true;
}
return false;
}