title: Matched value from input with Array object
body: <p>I want to match the value of user input with an array object and then return the same result to the table</p>
  <p>Here is my code</p>
  <pre><code>function myFunction() {
      var input, filter, table, tr, td, i, txtValue;
  
      var myList = dataDummy;
      input = document.getElementById(&quot;myInput&quot;);
  
      filter = input.value.toUpperCase();
      console.log(filter);
      table = document.getElementById(&quot;our-table&quot;);
      tr = table.getElementsByTagName(&quot;tr&quot;);
      for (i = 0; i &lt;  myList.length; i++) {
          td = (myList[i].nama);
          console.log(myList[i].nama);
          // td = tr[i].getElementsByTagName(&quot;td&quot;)[3];
          if (td) {
              txtValue = td.textContent || td.innerText;
              if (txtValue.toUpperCase().indexOf(filter) &gt; -1) {
                  tr[i].style.display = &quot;&quot;;
              } else {
                  tr[i].style.display = &quot;none&quot;;
              }
          }
      }
  }
  </code></pre>
  <p>here is the display when i search on the HTML
  <a href="https://i.stack.imgur.com/mMCWa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mMCWa.png" alt="enter image description here" /></a></p>
  <p>can someone tell me where did i do wrong here, the table supposed to show the same name with the input only, but it didn't works</p>