function filter_name(str) { if (str.length == 0) { articles.forEach(article => article.style.display = "block"); } else { articles.forEach(article => article.style.display = article.dataset.title.indexOf(str.toLowerCase()) === -1 ? "none" : "block"); } } let articles = Array.from(document.querySelectorAll("article")); document.querySelector("#search").style.display = "inline-block";