Ex No: 2 | USERNAME AND PASSWORD VALIDATION |
---|---|
Aim: | To write a JavaScript program to validate Username and Password entered by the user. |
Algorithm | |
Step1: Create a folder “Ex2” to place all the HTML files and Image files. | |
Step2: Create two HTML file “index.html” and “home.html”. | |
Step3: Add JavaScript code to get value of username and password from the text box. | |
Step4: Using IF statement compare the username and password value stored. | |
Step5: If the condition is true open "home.html" page. | |
Step6: Else display a message using Alert box. | |
Source Code | |
index.html
home.html
|
|
Result: | Thus JavaScript Code is written to validate Username and Password store in variable. |