You are here: irt.org | FAQ | JavaScript | Window | Q577 [ previous next ]
No. You have to use the window handle:
<form>
<input type="button" onClick="windowHandle = window.open('test.htm','windowName')" value="Open">
<input type="button" onClick="window['windowHandle'].close()" value="Close">
</form>Or:
<form>
<input type="button" onClick="windowHandle = window.open('test.htm','windowName')" value="Open">
<input type="button" onClick="windowHandle.close()" value="Close">
</FORM>See also the answer to FAQ#782 Is it possible to get access to a named window, opened with target=name?