Advertisement
Guest User

if statement

a guest
Mar 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.71 KB | None | 0 0
  1. <html>
  2.         <body>
  3.             <center>
  4.                     <h1>Login system</h1><hr/>
  5.                     <input type="text" placeholder="enter your name" id="uName"/><br/><br/>
  6.                     <input type="password" placeholder="enter your password" id="uPass"/><br/>
  7.                     <br/><br/>
  8.                     <input type="button" value="Login" onclick="checkLogin()"/>
  9.                     <hr>
  10.                     <div id="res"></div>
  11.                     <script>
  12.                         var userName="zeev";
  13.                         var password="12345";
  14.                        
  15.                         function checkLogin(){
  16.                                 if (uName.value==userName && uPass.value==password){
  17.                                     res.innerHTML="Hello my master !!!<br>Have a nice day :)";                             
  18.                                 }
  19.                                 else{
  20.                                     res.innerHTML="Why who are you??";
  21.                                 }
  22.                         }
  23.                     </script>
  24.             </center>
  25.         </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement