// Global variable to store a reference to the opened window
let openedWindow;
function openWindow() {
openedWindow = window.open("more-info.htm");
}
function closeOpenedWindow() {
openedWindow.close();
}Window: close() method / notebook
Window: close() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.