Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>confirm box</title>
- <script>
- function showAnswer() {
- var ans = confirm("Click a button");
- if (ans ==true) {
- document.write("You press Ok");
- }
- else {
- document.write("You press Cancel");
- }
- }
- </script>
- </head>
- <body>
- <p>click the button</p>
- <button type="button" onclick="showAnswer()" value="Show Answer">Click Me</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement