JSFiddle - React, Tailwind, and code Playground
HTML
<form id="profileform" name="profileform">
<input type="text" id="firstname">
<input type="button" id="testbutton" value="Test">
</form>
JavaScript
$('#testbutton').bind('click',function(){
try{
alert($('#profileform').checkValidity());
}
catch(err){'err='+err};
});