Files
adlist_mikrotik/static/js/stats.js
Mateusz Gruszczyński bc45c91d92 refactor ciagl dalszy
2025-08-29 10:46:50 +02:00

11 lines
480 B
JavaScript

document.addEventListener('input', (e) => {
const el = e.target.closest('[data-action="filter-table"]');
if (!el) return;
const table = document.querySelector(el.getAttribute('data-target') || '');
if (!table) return;
const q = (el.value || '').toLowerCase();
table.querySelectorAll('tbody tr').forEach(tr => {
const text = (tr.innerText || tr.textContent || '').toLowerCase();
tr.style.display = text.includes(q) ? '' : 'none';
});
});