Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- function s() {
- var username = document.forms["n1"]["n2"].value;
- var password = document.forms["n1"]["n3"].value;
- if (username != "salim") {
- document.querySelector("h2").innerHTML = "the username is wrong try again !!";
- return false;
- }
- if( password != "fadhil")
- {
- document.querySelector('h2').innerHTML = "the password is wrong try again!!";
- return false;
- }
- }
- </script>
- </head>
- <body>
- <form name="n1" action="#" onsubmit="return s()" method="post">
- <h2 style="color:red;background:black;"></h2>
- Name: <input type="text" name="n2" placeholder="salim"/>
- password: <input type="password" name="n3" placeholder="fadhil"/>
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement