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.getElementsByTagName("article")); document.getElementById("search").style.display = "inline-block";