Guest User

Untitled

a guest
May 10th, 2018
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. </script>
  5. <a href="main_frame.html">
  6. </a>
  7. <title>Login Form Design</title>
  8. <link rel="stylesheet" type="text/css" href="style1.css">
  9. <body>
  10. <div class="loginbox">
  11. <img src="3.jpg" class="avatar">
  12. <h1>Login Here</h1>
  13. <form>
  14. <p> <font color="white"><b>Username</b></font></p>
  15. <input id="username" type="text" name="" placeholder="Enter Username" >
  16. <p><font color="white"><b>Password</b></font></p>
  17. <input id="password" type="password" name="" placeholder="Enter Password">
  18. <input type="button" name="" id="jaadu" value="Login">
  19.  
  20. <a href="#">Lost yor password?</a><br>
  21. <a href="#">Don't have an Account?</a>
  22. </form>
  23. </div>
  24.  
  25. <script type="text/javascript">
  26.  
  27. let log = [
  28. {
  29. id: 'rajat',
  30. pass: 'singla'
  31. },
  32. {
  33. id:'ip',
  34. pass: 'nano'
  35. }
  36. ];
  37.  
  38.  
  39. let jaadu = document.getElementById('jaadu')
  40.  
  41. jaadu.addEventListener('click', function () {
  42. let username = document.getElementById('username').value
  43. let password = document.getElementById('password').value
  44.  
  45. console.log(log);
  46. console.log(username);
  47. console.log(password);
  48. if(username == log[0].id && password == log[0].pass)
  49. window.location.href= '/main_frame.html'
  50. else if(username == log[1].id && password == log[1].pass)
  51. window.location.href= '/main_frame.html'
  52. else {
  53. console.log(`yaha aaya hai`);
  54. alert('Username and Password are incorrect');
  55. window.location.href= '/login page.html'
  56. }
  57. })
  58.  
  59. </script>
  60.  
  61. </body>
  62. </head>
  63. </html>
Add Comment
Please, Sign In to add comment