How to Validate Aadhaar Card Number Using Regular Expression in Javascript Full Project For Beginners

 

Welcome folks today in this blog post we will be validating aadhaar number using regular expression in javascript.All the full source code of the application is given below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.html file and copy paste the following code

 

 

index.html

 

 

<script> 
   function validation()
       {   
            
            var regexp=/^[2-9]{1}[0-9]{3}\s{1}[0-9]{4}\s{1}[0-9]{4}$/;
           
            var x=document.getElementById("aadhaar").value;
           if(regexp.test(x))
               {
                   window.alert("Valid Aadhar no.");
                   
               }
        else{ window.alert("Invalid Aadhar no.");
              }
   </script>

Leave a Reply