Q:

Get  inside  of a  using Javascript

I have table with class tablesorter. In that table is tbody that contains many of tr. In tr is td class=status that showing "UP" text. I need to get in every tr and check if the td class=status is UP. If is not UP then I need to hide that tr. HTML is on the picture.
Any ideas?

A:

First get the list of trs from the table and convert to an array:
[...document.querySelector('table').querySelectorAll('tr')]
  // then forEach over the array to conditionally hide the row
  .forEach(tr => {
    // select the element with class 'status' check if txt is not UP
    const el = tr.querySelector('.status');
    if (!el || el.textContent.trim() !== 'UP') {
      tr.style.display = 'none'; // hide tr
    }
  });

