User:Energy X/common.js

var cardimage = Array.from(document.getElementsByClassName("lightbox-caption")); var iterator;

for(var i = 0; i < cardimage.length; i++){ iterator = cardimage[i];

iterator.addEventListener("mouseout", function{       this.parentElement.style.background = "initial";    }); iterator.addEventListener("mouseover", function{       if(this.innerHTML.includes("Monster")){            this.parentElement.style.background = "brown";        }    }); }