Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script type="text/javascript">
- <!--
- function confirmation() {
- var answer = confirm("Leave my web site?")
- if (answer){
- alert("Bye bye!")
- window.location = "http://www.google.com/";
- }
- else{
- alert("Thanks for staying!")
- }
- }
- //-->
- </script>
- <title>JavaScript confirm choice demo</title>
- </head>
- <body>
- <form>
- <input type="button" onclick="confirmation()" value="Leave web site" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement