1
0
dwelling-home/web/assets/js/mindflow.js

12 lines
365 B
JavaScript
Raw Permalink Normal View History

2023-02-05 00:54:18 +04:00
const articles = document.getElementsByTagName("article");
document.getElementById("filter").classList.remove("hidden");
function filter(e) {
for (const a of articles)
a.classList.toggle("hidden",
!(e.target.name === "all" || a.id.startsWith(e.target.name)));
}
for (const b of document.getElementsByTagName("button"))
b.addEventListener("click", filter);