JSFiddle - React, Tailwind, and code Playground
by Pasky Org
HTML
<form id="profileform" name="profileform">
<input type="text" id="firstname" required>
<input type="button" id="testbutton" value="Test">
</form>
JavaScript
$('#testbutton').on('click',function(){
try{
alert($('#profileform')[0].reportValidity());
}
catch(err){'err='+err};
return $('#profileform')[0].reportValidity();
});