I can open a new page in SAME tab by using function on button click
This is the file current_tab.html:
<input id="openHere" type="button" value="Open Here" onclick="openHere()"/>
This is the file current_tab.js:
function openHere(){
window.open("new_tab.html","_self");
}
This new opened page must have a button which if pressed closes the tab:
This is the button in new_tab.html
<input id="close" type="button" value="Close" onclick="close()"/>
And this is the function on file new_tab.js:
function close() {
window.close();
}
When i press the Close button nothing happens, what am I missing?