Skip to content
Advertisement

Uncaught TypeError: Cannot read property ‘style’ of null at HTMLButtonElement

when trying to press nav-toggle icon to appear the navbar content, i get this error.

JavaScript

here is my javascript:

JavaScript

Advertisement

Answer

You should use the id attribute for the ul since you are trying to get it using getElementById.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement