Advertisement
Guest User

Untitled

a guest
Apr 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" href="master.css">
  6. <title>Day Four</title>
  7. </head>
  8. <body>
  9. <h1>Log In</h1>
  10.  
  11. <form onsubmit="valid()">
  12. <label for="username">Username:</label>
  13. <input id = 'user-name' type="text" name="" value="" required>
  14.  
  15. <label for="password">Password:</label>
  16. <input id = 'pass-word' type="password" name="" value="" required>
  17.  
  18. <input id = 'log-in'type="submit" name="" value="Log In">
  19. </form>
  20.  
  21. </div>
  22.  
  23. </body>
  24. <script src="mainJs.js" charset="utf-8"></script>
  25. </html>
  26.  
  27. function valid(){
  28. var username = document.querySelector('#user-name').value;
  29. var password = document.querySelector('#pass-word').value;
  30.  
  31. if(username === 'test' && password === '1'){
  32. window.open("gradebook.html")
  33.  
  34. }else{
  35. alert("Wrong username or password")
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement