I'm trying to create a simple menu for an assignment, but I'm having trouble hiding the current menu page and show the one corresponding to the button clicked. How can i do that? I'm new to javascript.
I have a button handler to deal with the click of the button that brings the new page. I have tried disabling the nav where all the elements are but that doesn't seem to work.
function main() {
var ButtonSingle = document.getElementsId("UJOGADOR");
ButtonSingle.addEventListener("click", btnSingleHandler);
}
function btnSingleHandler(ev) {
var page = document.getElementsId("menu");
page.disabled = true;
}
html:
<body>
<main>
<nav id = "menu">
<button id="UJOGADOR"><img src="../resources/btn4.png"></button>
</nav>
</main>
<audio loop>
<source src="">
</audio>
</body>
What is meant to happen is the current menu page is hidden and a new one will appear, but when i run this nothing happens.