</div><div>Something over</div>
<div id="info">
Click to hide (cannot be undone)
</div>
<div>Something under</div>
.hide {
animation: opacity_animation 1s ease forwards;
}
@keyframes opacity_animation {
from {
opacity: 100;
}
to {
opacity: 0;
}
}
const info = document.getElementById("info");
info.addEventListener("click", () => {
info.classList.add("hide");
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.