mirror of
https://github.com/0xMarcio/cve.git
synced 2026-02-12 18:42:46 +00:00
16 lines
543 B
JavaScript
16 lines
543 B
JavaScript
(function(){
|
|
const filterInputs = document.querySelectorAll('[data-filter-table]');
|
|
filterInputs.forEach(input => {
|
|
const tableId = input.dataset.filterTable;
|
|
const table = document.getElementById(tableId);
|
|
if (!table) return;
|
|
input.addEventListener('input', () => {
|
|
const term = input.value.trim().toLowerCase();
|
|
for (const row of table.querySelectorAll('tbody tr')) {
|
|
const text = row.innerText.toLowerCase();
|
|
row.style.display = text.includes(term) ? '' : 'none';
|
|
}
|
|
});
|
|
});
|
|
})();
|