Making every page on a div rainbow – Javascript
I'm trying to create Javascript code that turns every div into a linear gradient. Here's what I tried: var elem = document.getElementsByTagName("div"); elem.style.backgroundImage = "linear-gradient(45deg, red, yellow, orange, green, blue, purple, pink)"; It's giving me this error: Uncaught TypeError: Cannot…