krahny
New Member
- Messages
- 25
- Reaction score
- 0
- Points
- 0
I want to make a page that, when the user presses the exit button, a confirmation box appears that says "Are you sure you want to exit?". If you click OK, then it closes, and if you click Cancel it dosen't. Heres the code that I have:
When I exit with this code, though, it exits and then displays the confirmation box, witch is useless since the page has already closed.
Could someone please help me figure out a way to stop the exit, and then exits if the user presses the OK button.
HTML:
<body onunload="confirm('Are you sure you want to exit?')">
Could someone please help me figure out a way to stop the exit, and then exits if the user presses the OK button.
Last edited: