Codesupplier.com

free html codes for your website

Close window button

Using this simple Javascript Code allows users to close a window by simply clicking a button located on your webpage. If you write eBooks you can use this code in them as well (as long as your software supports javascript).   

If you want to use this Javascript on your page to make things easier for your users copy and paste the below javascript code where you would like the button to appear. We recommened keeping "close window" as your button text, but you can change the text in red if neccassary.

 

<form method="post">
<input type="button" value="
Close Window"
onclick="window.close()">
</form>

< Go Back to Javascript Snippets