Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1332 How can you close a child window by clicking a form button on the parent window?

You are here: irt.org | FAQ | JavaScript | Window | Q1332 [ previous next ]

Assuming the child has been opened like this:

<script language="JavaScript"><!--
winId = window.open(.....);
//--></script>

Then use:

<form>
<input type="button" onClick="if (!winId.closed) winId.close()" value="Close Popup">
</form>

©2018 Martin Webb