I have problem with weird behaviour in JavaScript that I don't understand:
If I get element (for example a row in table) like this:
var someElement = document.getElementById("row1");
And then try to find element by class from that element (column for example) and change the innerHTML, nothing happens:
someElement.getElementsByClassName("column1").innerHTML = "new text";
But if I instead do this:
someElement.childNodes[0].innerHTML= "new text";
The elements innerHTML changes and is visible on the DOM. Why is this happening like this? I think the class thing would produce cleaner code for me right now, so is there a way to get the class method to work as I think it should?
I'm using the newest version of Chrome.