Skip to content
Advertisement

open/close sidebar changing buttons

JavaScript
JavaScript

it says me -> Uncaught TypeError: document.getElementById(…) is null

Advertisement

Answer

document.getElementById does not target a node by its class="" but by its id=""

JavaScript

To target an element by its class you can use document.querySelector

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