The code below works when adding but not when removing. I am not sure why.
Here is the codepen https://codepen.io/julioperez224-og/pen/Pombdaq
const closeBtn = document.getElementById("close-container");
const modal = document.getElementById("modal");
function expanding(){
modal.classList.add("expand");
closeBtn.classList.add("display");
}
function disapear(){
closeBtn.classList.remove("display");
modal.classList.remove("expand");
console.log("disapear")
}
modal.addEventListener("click", expanding);
closeBtn.addEventListener("click", disapear);