I have a problem with some Javascript. The code comes up with the following error.
Cannot read property 'style' of null
function openNav() {
document.getElementById("mySidenav").style.width = "100vw";
document.getElementById("main").style.marginRight = "100vh";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginRight= "0";
}
How do I fix this problem.