I was sitting looking at a JS tutorial for show hide now I'm getting the error message "Cannot read property 'style' of null"
it's from here
https://www.w3schools.com/jsref/prop_style_display.asp
<span class="hamIcon" onclick="showNav()">☰</span>
function showNav() {
var x = document.getElementById("mainControl");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
same with
function showNav() {
document.getElementsByClassName('mainControl').style.display = 'block' ? 'none' : 'block';
}