heroweb/poc/in/assets/js/alert.js
2024-09-02 07:28:06 +02:00

11 lines
300 B
JavaScript

if (document.querySelector("[alert-close]")) {
var buttons = document.querySelectorAll("[alert-close]");
buttons.forEach((button) => {
button.addEventListener("click", function () {
let alert = this.closest("div[alert]");
console.log(alert);
alert.remove();
});
});
}