I'm attempting to modify the CSS of my website so that when a user clicks on a div, the background changes to a gif. However, I am having trouble accomplishing this using JavaScript!
Here is my code:
function easterFun(){
var changeBG = document.getElementById("body");
changeEaster.setAttribute("style","background-image:url(eatser.gif)")
In addition, my div is not responding when clicked and the code is not executing. Can someone please help me identify the issue?
Welcome to the Holiday Spirit website!!!
<div id="easter"onclick="easterFun()" style = "cursor: pointer">Easter!</div>
<div id="xmas" onclick="xmasFun()">Christmas</div>
</body>
</html>