I am trying to open a new window with a button. The window needs to have a specific height and width. Whenever I click the "open" button it just opens a completely new tab.
var aWindow;
function openWindow() {
aWindow = window.open("", "", "width=400, height = 200");
}
function closeWindow() {
if (aWindow) {
aWindow.close();
}
}
<html>
<body>
<button onclick="openWindow();">Open</button>
<button onclick="closeWindow();">Close</button>
</body>
</html>