niro0711

my gate

Jan 24th, 2019
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <body>
  3.         <center>
  4.             <h1>My Gate</h1><hr/>
  5.             <input type="button" value="gate 1" onclick="clickGate1()"/><br/><br/><br/>
  6.             <input type="button" value="gate 2" onclick="clickGate2()"/><br/><br/><hr/>
  7.             <div id="res"></div>
  8.             <script>
  9.                 //first initilaze of our two boolean
  10.                 var bGate1=false,bGate2=false;
  11.                 function clickGate1()
  12.                 {
  13.                     //if bgate1 is already true, you click on gate 1 again
  14.                     if (bGate1)
  15.                     {
  16.                         //tell the user that he is a moron....
  17.                         res.innerHTML="in your mother, leave me alone";
  18.                         reset();
  19.                         return;
  20.                     }
  21.                     //if bgate is true, the user is on his way out
  22.                     if (bGate2)
  23.                     {
  24.                         res.innerHTML="good bye!!!";
  25.                         reset();
  26.                         return;
  27.                     }
  28.                     //first click so, we changed the value of the variable to true.
  29.                     bGate1=true;
  30.                 }
  31.                 function clickGate2()
  32.                 {
  33.                     if (bGate2)
  34.                     {
  35.                         res.innerHTML="in your mother, leave me alone";
  36.                         reset();
  37.                         return;
  38.                     }
  39.                     if (bGate1)
  40.                     {
  41.                         res.innerHTML="no Good bye, welcome!!!";
  42.                         reset();
  43.                         return;
  44.                     }
  45.                     bGate2=true;
  46.                 }
  47.                 function reset()
  48.                 {
  49.                     bGate1=false;
  50.                     bGate2=false;
  51.                 }
  52.             </script>
  53.         </center>
  54.     </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment