20 lines
591 B
JavaScript
20 lines
591 B
JavaScript
document.addEventListener("DOMContentLoaded", () => {
|
|
const table = document.querySelector("[data-project-table]");
|
|
if (!table) {
|
|
return;
|
|
}
|
|
|
|
const rows = Array.from(table.querySelectorAll("tbody tr"));
|
|
const filterInput = document.querySelector("[data-project-filter]");
|
|
|
|
if (filterInput) {
|
|
filterInput.addEventListener("input", () => {
|
|
const query = filterInput.value.trim().toLowerCase();
|
|
rows.forEach((row) => {
|
|
const match = row.textContent.toLowerCase().includes(query);
|
|
row.style.display = match ? "" : "none";
|
|
});
|
|
});
|
|
}
|
|
});
|