JQuery Example
Screen shot
jQuery Form Validation



<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>



<!-- Html form -->

<form name="frm" action="" method="post">

Full Name<input type="text" id="fullname"><br>

<div id="namemsg" style="color: red;"></div>

Email<input type="text" id="email"><br>

<div id="emailmsg" style="color: red;"></div>

<input type="submit" id="btnsubmit">



<!-- Jquery validation code-->

<script type="text/javascript">

$(document).ready(function() {

$("#btnsubmit").click(function() {



    var str;

var fullname = $("#fullname").val();

var email = $("#email").val();

var regEx = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

    var validEmail = regEx.test(email);  

    var str=true;


$("#namemsg").html("Name must be fill out");




$("#emailmsg").html("Email must be fill out");



    else if(!validEmail){

$("#emailmsg").html("Enter Valid Email");



return str;