document.getElementsByClassName("red")[0].addEventListener("mouseenter",function(){this.style.background ="red";this.style.transition = "0.5s";this.style.boxShadow = "0px 0px 5px 5px"}); document.getElementsByClassName("red")[0].addEventListener("mouseleave",function(){this.style.background ="none";this.style.transition = "0.5s";this.style.boxShadow = "0 0 10px 5px"}); document.getElementsByClassName("green")[0].addEventListener("mouseenter",function(){this.style.background ="green";this.style.transition = "0.5s";}); document.getElementsByClassName("green")[0].addEventListener("mouseleave",function(){this.style.background ="none";this.style.transition = "0.5s";}); document.getElementsByClassName("blue")[0].addEventListener("mouseenter",function(){this.style.background ="blue";this.style.transition = "0.5s";}); document.getElementsByClassName("blue")[0].addEventListener("mouseleave",function(){this.style.background ="none";this.style.transition = "0.5s";});