I am trying to move the "mynav" section up so that it can become a child of body (very top of html). This should apply only in mobile version of the website.
Another topic I found and tried to utilize:
How to move all HTML element children to another parent using JavaScript?
I tried the thing specified in this topic up top but I dont think I was really successful as it was still positioning itself under id="burger"
var myNav = document.getElementById('myNav');
var myBody = document.getElementById('myBody');
while (myBody.childNodes.length > 0) {
myNav.appendChild(myBody.childNodes[0]);
}
https://jsfiddle.net/8n6wjtm7/
I want "mynav" to be moved under body element in mobile version. I would like to use it for full page opening. Is there a way to do this only in Javascript? I don't really prefer Jquery. Thanks.