Advertisement
1xptolevitico69

If else statement. Basics.

Oct 29th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.77 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang=en>
  3. <head>
  4. <title></title>
  5. <meta charset=utf-8>
  6. <meta name="viewport" content="width=device-width">
  7. <style>
  8.  
  9. #div_1{
  10.   background-color:red;
  11.   display:inline-block;
  12.   padding:5px;
  13.   position:absolute;
  14. }
  15.  
  16. #inp_1{
  17.   font-size:25px;
  18. }
  19.  
  20. #bt_1{
  21.   font-size:25px;
  22. }
  23.  
  24. </style>
  25. </head>
  26. <body>
  27.  
  28. <div id='div_1'>
  29. <input id='inp_1' type='search'  placeholder='type'/>
  30. <button id='bt_1'>Check</button>
  31. </div>
  32.  
  33.  
  34. <script>
  35. var x = 'letmein';
  36.  
  37. bt_1.onclick=function(){
  38. if(inp_1.value==''){
  39.    inp_1.value='Fill in please';
  40.    }else if(inp_1.value == x){
  41.      alert('welcome');  
  42.       location.href="https://www.youtube.com/embed/8nMVrN67zm4";    
  43.   }else{
  44.         alert('wrong password');
  45.   }
  46. }
  47.  
  48. </script>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement