I try to loop through all the nodes in a div. I use this code to have access to all the nodes in the div.
var div = document.getElementById('thedivId');
var childs = div.childNodes
and then i try to loop through it using childs.length
but in the console when i run it i am getting this error:
Cannot read property 'childNodes' of null
I cant understand why this happens, I know that isn't an array, but the node list has the property length, and i have seen it used in here: http://www.w3schools.com/jsref/prop_node_childnodes.asp