File size: 574 Bytes
7d419bd
 
 
1
2
3
4
const input=document.getElementById('model-search'),tables=[...document.querySelectorAll('table.board')];
function filter(){let shown=0;for(const table of tables){let rank=0;for(const row of table.tBodies[0].rows){row.hidden=!row.dataset.search.includes(input.value.trim().toLowerCase());if(!row.hidden)row.cells[0].textContent=++rank;}shown=rank;}document.getElementById('ranking-count').textContent=shown+' of 14 configurations';}
input.addEventListener('input',filter);tables.forEach(t=>t.querySelectorAll('th[data-k]').forEach(th=>th.addEventListener('click',filter)));