axentix
Version:
Axentix is a framework mixing fully customizable components & utility-first classes, leaving the design choice to the developer.
10 lines (9 loc) • 369 B
JavaScript
const o = (t) => {
const e = t.currentTarget.getAttribute("data-close");
if (!e) return console.error("[Axentix] A closable target must be set");
const n = document.getElementById(e);
n && n.remove();
}, r = () => {
document.querySelectorAll("[data-close]").forEach((e) => e.addEventListener("click", o));
};
document.addEventListener("DOMContentLoaded", r);