function openNav() {
document.getElementById("mySidenav").style.width = "200px";
}
/* Set the width of the side navigation to 0 */
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
<div onclick="openNav()" class="minimenubutton"><img src="images/menu.png"/></div>
I'm looking for a way to have the function change every time I click this so that I can open my div with one button. As of right now, I have closeNav set to a button inside that div, but I'd like to do it all with just the "minimenubutton."
I'm new to Javascript so please go easy on me. I looked up toggles but couldn't figure them out.