SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  function solve() {
  2.  
  3.      let search = document.getElementById("searchBtn");
  4.  
  5.      search.addEventListener("click", containObj);
  6.  
  7.      function containObj() {
  8.          const input = document.getElementById('searchField');
  9.          const inputValue = input.value;
  10.  
  11.          let tr = document.querySelectorAll("tbody > tr");
  12.  
  13.           let unselect = Array.from(tr)
  14.               .forEach(el => el.classList.remove('select'));
  15.  
  16.          const td = document.querySelectorAll('tbody > tr > td');
  17.  
  18.          let selectedClickElements = Array.from(td)
  19.              .filter(e => e.textContent.includes(inputValue))
  20.              .forEach(el => el.parentNode.className = 'select');
  21.  
  22.          input.value = '';
  23.      }
  24.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top