I have a simple function, which should close
the tab if a user clicks a button
. For some reason, I keep getting an error that it is not a function.
It's a simple function, and I have no idea why it wouldn't work...
Uncaught TypeError: deny is not a function at HTMLButtonElement.onclick (login.html:183)
Any help would be welcome
EDIT: Thanks for pointing to other threads. It might be true that it wouldn't close the window. BUT why does it say that deny is not a function?
function deny(){
console.log("deny function executed.. :D ");
window.close();
};
<button id="deny" onclick="deny()">
<span id="d">Close</span>
</button>