Advertisement
bobo_bobkata

Untitled

Oct 9th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function solve() {
  2. let tds = document.getElementsByTagName("tr");
  3. document.getElementById("searchBtn").addEventListener('click', function (e) {
  4. for (let i = 0; i < tds.length; ++i) {
  5. tds[i].classList.remove("select");
  6. }
  7. let inputValue = document.getElementById("searchField").value;
  8.  
  9. for (let i = 0; i < tds.length; ++i) {
  10. let current = tds[i].innerHTML;
  11. if (current.includes(inputValue)) {
  12. tds[i].className = "select";
  13. }
  14. }
  15. }
  16. );
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement