2021-12-04 22:10:40 +01:00
|
|
|
function filter_name(str)
|
|
|
|
{
|
|
|
|
if (str.length == 0) {
|
2022-12-09 13:17:29 +01:00
|
|
|
articles.forEach(article => article.style.display = "block");
|
2021-12-04 22:10:40 +01:00
|
|
|
} else {
|
2022-12-09 13:17:29 +01:00
|
|
|
articles.forEach(article => article.style.display = article.dataset.title.indexOf(str.toLowerCase()) === -1 ? "none" : "block");
|
2021-12-04 22:10:40 +01:00
|
|
|
}
|
|
|
|
}
|
2022-12-09 13:17:29 +01:00
|
|
|
|
2024-05-06 12:45:39 +02:00
|
|
|
let articles = Array.from(document.querySelectorAll("article"));
|
|
|
|
document.querySelector("#search").style.display = "inline-block";
|