#nav{
display:none;
}
// self executing function
(function() {
var x = document.getElementById("nav");
x.style.display = "none";
})();
// self executing function
(function() {
if(window.localStorage.getItem('nav') === null){
window.localStorage.setItem('nav', 'none');
}
var x = document.getElementById("nav");
x.style.display = window.localStorage.getItem('nav');
})();
function myFunction() {
var x = document.getElementById("nav");
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
window.localStorage.setItem('nav', x.style.display);
}