This is
Window.close()
. Note that
window.close()
would work on a current window; but 1) it won't work in all cases and 2) not what you need.
"Parent" and "child" probably means that you created some window from what you call "parent". When you do so, you will receive the window object reference for the newly created window. You will need to preserve this reference to use the new window object later on, and to close it:
var myChild = window.open()
myChild.close()
Please see:
https://developer.mozilla.org/en-US/docs/Web/API/Window/open[
^],
https://developer.mozilla.org/en-US/docs/Web/API/Window/close[
^].
Note that creation of popup windows can be blocked by the browser.
—SA