Answer the question
In order to leave comments, you need to log in
How to implement search with table sorting?
There is a table in the first column of which the row number is indicated Implemented a search in the table with cell highlighting in which a match was found and a row in which a match was found goes up.
function filter(row) {
var val = _input.value.toLowerCase();
Arr.forEach.call(row.cells, function (cell) {
if (cell.textContent.toLocaleLowerCase().indexOf(val) !== -1 && val) {
addClass(cell);
row.parentNode.insertBefore(row,row.parentNode.rows[0]);
}
else {
removeClass(cell)
}
});
}
Answer the question
In order to leave comments, you need to log in
List.js is a simple, lightweight and efficient script to help you .
jsfiddle.net/k7d1w9vo
Hardly what you need, but I described the idea. If IE9 is important, then it is worth replacing all uses of classList with polyfills, and remember that the input event does not fire in it when backspace is clicked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question