Array.from(document.querySelectorAll(".reveal")).forEach(function(reveal) { reveal.addEventListener("click", function (e) { console.log("Surprise, there's text!"); reveal.classList.toggle("tada"); }) }); Array.from(document.querySelectorAll(".entrance")).forEach(function(entrance) { entrance.addEventListener("mouseover", function (b) { console.log("Surprise, there's text!"); entrance.classList.toggle("tada"); }) }); // function myFunction() { // var popup = document.getElementByClass("myPopup"); // popup.classList.toggle("show"); // } // const arrows = document.getElementsByClassName("myPopup"); // const popup = document.createElement("span"); // popup.setAttribute("class", "popIN"); // popup.style.visibility = "hidden"; // popup.style.width = "30px"; // popup.style.position = "absolute"; // popup.style.bottom = "110%"; // popup.style.left = "10%"; // popup.style.marginleft = "-4px"; // popup.style.border = "solid 1pt"; // popup.style.borderadius = "3px"; // popup.style.padding = "4px 0"; // popup.style.color = "red"; // popup.style.backgroundColor = "white"; // popup.style.zIndex = "1"; // const popup_on = ((evt) => { // const title = evt.target.title; // popup.style.visibility = "visible"; // popup.innerHTML = // ${title} ; // }); // const popup_off = ((ev) => { // popup.style.visibility = "hidden"; // }); // // document.getElementByClassName("myPopup").addEventListener("mouseover", myFunction, false); // for (let x of arrows) { // if (x.tagName === "MARK") { // x.addEventListener("click", popup_on, false); // x.addEventListener("click", popup_off, false); // } // } // }