var rows = document.getElementById("main").rows, nodes = []; for (var i = 0; i < rows.length; i++) if (rows[i].cells[rows[i].cells.length - 1].innerHTML.replace(/\s|\n/g, "") == "0") nodes.push(rows[i]);