DEV Community

Discussion on: Let's build a responsive navbar and hamburger menu using HTML, CSS, and Javascript.

Collapse
 
iancahn profile image
Ian Cahn

Hey Ryan, I had this exact same issue, so Im gonna go ahead and guess you are using Chrome. Chrome has issues when using JS in localhost environment. To fix this, just move your js script tag to your footer, instead of your header. This fixed it for me, strange but hey...

Collapse
 
srichmond3000 profile image
Steve Richmond

Another solution is to add the 'defer' attribute to the script element.