From 6f45549b73e92b469b1b4c74593cccaf09f8e6d1 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 31 Aug 2022 08:29:31 +0400 Subject: [PATCH] hasAttribute() works not like I thought. Here just a comparison with a string is needed. --- homepage/static/assets/js/mindflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homepage/static/assets/js/mindflow.js b/homepage/static/assets/js/mindflow.js index 2ece044..984ebd9 100644 --- a/homepage/static/assets/js/mindflow.js +++ b/homepage/static/assets/js/mindflow.js @@ -6,7 +6,7 @@ const articles = document.getElementsByTagName("article"); document.getElementById("filter").classList.remove("hidden"); for (let i = 0; i < buttons.length; ++i) - if (buttons[i].hasAttribute("name")) + if (buttons[i].name !== "") buttons[i].addEventListener("click", e => { const category = e.target.name; for (let j = 0; j < articles.length; ++j)