Javascript, how can I access a specific child of a row?

Maybe you can try this:

var tRow = document.getElementById("tableName").getElementsByTagName("tr");

for(var i = 0; i < tRow.length; i++){
    if(tRow[i].id == "name of your id"){
        //do something
    }
}

I found this solution in combining the two most rated one:

Instead of using childNodes you could get Elements of typ td below this row with:

var array_td = document.getElementById('id33322010100167').getElementsByTagName("td");

To get the content of the first td you could use:

array_td[1]

The main benefit of this is, that you do not have all the whitespace you dont want to handle inside the array and you dont have to change the index if some new childs (not tds) be added.


var index = 1; // second element
var child = document.getElementById('id33322010100167').childNodes[index]