Why is the image NULL (javascript)?

This is because menuexpand doesn’t have image or you are displaying it
incorrectly.

Your path must be incorrect while you are importing. Just right click on the image you are interested in image and click on copy path.use that path while importing. Now, replace all the back slashes to forward slash in the path.

Also change :-

document.getElementById(menuiconexpand).style.display = "block";
to

document.querySelector(".menuiconexpand").style.display = "block";

Leave a Comment