I'm trying to make a Side Navigation
, so on internet search, I found a little tutorial on the site: How TO - Side Navigation
However, in my example I wanted a single button to open, and close, so I made the following changes:
function closeNav()
{
if (document.getElementById("mySidenav").style.width < 250)
{
document.getElementById("mySidenav").style.width = "250px";
}
else
{
document.getElementById("mySidenav").style.width = "40px";
}
}
But, it only works once, that is, it opens and closes after it no longer works.