const watcher = new CloseWatcher();
const picker = setUpAndShowPickerDOMElement();
let chosenValue = null;
watcher.onclose = () => {
chosenValue = picker.querySelector("input").value;
picker.remove();
};
picker.querySelector(".close-button").onclick = () => {
watcher.requestClose();
};CloseWatcher: requestClose() method / notebook
CloseWatcher: requestClose() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.