<ul class="menu">
<li>hello, world!!</li>
<li>fuck the world</li>
<li>fuck everything</li>
</ul>
<section></section>
<section></section>
<section></section>
<section></section>
<section></section>
section {
height: 400px;
}
section:nth-child(odd) { background: white; }
section:nth-child(even) { background: black; }
.menu {
position: fixed;
font: bold 48px monospace;
text-decoration: underline;
color: white;
mix-blend-mode: difference;
}
function createSearch(selector, valFn) {
$(selector).on('input', function() {
const val = $(this).val().toLowerCase();
$('#tabname tbody tr')
.hide()
.filter((i, n) => valFn(n).toLowerCase().includes(val))
.show();
});
}
createSearch('#search_table', tr => $('input[name^=name]', tr).val());
createSearch('#search_card', tr => $('[data-item-name="name"]', tr).text());
Просто не хотел засорять вопрос.
Вот на кодепен