Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <center>
- <h1>My Gate</h1><hr/>
- <input type="button" value="gate 1" onclick="clickGate1()"/><br/><br/><br/>
- <input type="button" value="gate 2" onclick="clickGate2()"/><br/><br/><hr/>
- <div id="res"></div>
- <script>
- //first initilaze of our two boolean
- var bGate1=false,bGate2=false;
- function clickGate1()
- {
- //if bgate1 is already true, you click on gate 1 again
- if (bGate1)
- {
- //tell the user that he is a moron....
- res.innerHTML="in your mother, leave me alone";
- reset();
- return;
- }
- //if bgate is true, the user is on his way out
- if (bGate2)
- {
- res.innerHTML="good bye!!!";
- reset();
- return;
- }
- //first click so, we changed the value of the variable to true.
- bGate1=true;
- }
- function clickGate2()
- {
- if (bGate2)
- {
- res.innerHTML="in your mother, leave me alone";
- reset();
- return;
- }
- if (bGate1)
- {
- res.innerHTML="no Good bye, welcome!!!";
- reset();
- return;
- }
- bGate2=true;
- }
- function reset()
- {
- bGate1=false;
- bGate2=false;
- }
- </script>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment