JSFiddle - React, Tailwind, and code Playground
by Ahmad SM
HTML
<h1>Form Validation Example</h1>
<form id='registerForm' name='registerForm' method='post' action='' > <p>
Name: <input type='text' name='name' id='name' class='required' />
</p>
<p>
Email: <input type='text' name='email' id='email' class='required' />
</p>
<p>
<input type='submit' name='Submit' value='Submit' />
</p>
</form>
CSS
.error {
font: normal 10px arial;
padding: 3px;
margin: 3px;
background-color: #ffc;
border: 1px solid #c00;
}
body{font-size:x-large;background:#CCC;}
h1{margin-bottom:20px;}
form{padding:50px;}
JavaScript
$(document).ready(function(){
$("#registerForm").validate();
});