»
EnglishFrenchVietnamese

Print - Confirm Close - JavaScriptBank.com

Full version: jsB@nk » Snippet » Confirm Close
URL: https://www.javascriptbank.com/confirm-close.html

Confirm Close © JavaScriptBank.comUse this JavaScript to confirm the closing of a window. It includes a cancel option. A valuable tool for those important popups.

Full version: jsB@nk » Snippet » Confirm Close
URL: https://www.javascriptbank.com/confirm-close.html



JavaScript
<script type="text/javascript"><!-- Begin/*Created by: Steeveeo :: http://www.freewebs.com/steeveeo3000 */function confirmClose() {  alert("You have chosen to close this window");    if (confirm("Are you sure?")) {      parent.close();    }    else      alert("Close cancelled."); {    }}// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form><input type="button" value="Close" onclick="confirmClose()"></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->