DOM Manipulation Click Mouse Event
Advertisements I was trying to change the color of the background of the web page with a mouse click, below are the lines for the same. let bodyvar = document.querySelector(‘body’); bodyvar.addEventListener(“click”,generate); function generate(){ bodyvar.style.backgroundColor = “red”; } When I test individual lines in console it is selecting the body and the function and everything works… Read More DOM Manipulation Click Mouse Event