Advertisement
Guest User

df

a guest
Aug 2nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function s() {
  6. var username = document.forms["n1"]["n2"].value;
  7. var password = document.forms["n1"]["n3"].value;
  8. if (username != "salim") {
  9. document.querySelector("h2").innerHTML = "the username is wrong try again !!";
  10. return false;
  11. }
  12.  
  13. if( password != "fadhil")
  14. {
  15. document.querySelector('h2').innerHTML = "the password is wrong try again!!";
  16. return false;
  17. }
  18. }
  19. </script>
  20. </head>
  21. <body>
  22.  
  23. <form name="n1" action="#" onsubmit="return s()" method="post">
  24.  
  25. <h2 style="color:red;background:black;"></h2>
  26.  
  27. Name: <input type="text" name="n2" placeholder="salim"/>
  28. password: <input type="password" name="n3" placeholder="fadhil"/>
  29.  
  30. <input type="submit" value="Submit">
  31. </form>
  32.  
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement