首页 > 解决方案 > BST 和表设置反应

问题描述

当我调用 BST 搜索的 find 功能时,它们的结果来得非常快

    td = tree.find(e.target.value)
    if (td !== null) {
      for (i = 0; i < tr.length; i++) {
var item = tr[i].getElementsByTagName("td")[5]
    if (td.val === item) 
          tr[i].style.display = "";
         else 
          tr[i].style.display = "none";
      }
}



and td is eleman of table , and i want to compare with value of item , i canot do this becuse result of find very fast and tr[i].getElementsByTagName("td")[5] is undefied

标签: javascripthtmlcssreactjs

解决方案


推荐阅读