Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve() {
- document.querySelector('#searchBtn').addEventListener('click', onClick);
- function onClick() {
- // TODO:
- const listTr= document.querySelectorAll('table.container tbody tr');
- const searchfield= document.querySelector('#searchField');
- for (const trel of listTr) {
- const listv=trel.querySelectorAll('td');
- let issearched= false;
- trel.className='';
- for (const el of listv) {
- if(el.textContent.toLowerCase().includes(searchfield.value) ){
- issearched= true;
- break;
- }
- }
- if(issearched ==true){
- trel.className='select';
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement