1st commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
function filterTable() {
|
||||
const input = document.getElementById('search');
|
||||
const filter = input.value.toLowerCase();
|
||||
const table = document.getElementById('gun-stats');
|
||||
const tr = table.getElementsByTagName('tr');
|
||||
|
||||
for (let i = 1; i < tr.length; i++) {
|
||||
const td = tr[i].getElementsByTagName('td')[1];
|
||||
if (td) {
|
||||
const txtValue = td.textContent || td.innerText;
|
||||
if (txtValue.toLowerCase().indexOf(filter) > -1) {
|
||||
tr[i].style.display = '';
|
||||
} else {
|
||||
tr[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user