</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");
});
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.