javascript - innerHTML not working on node -


in script node1.data & node1.textcontent working node1.innerhtml not displaying anything, , i'm not getting why.

var text = []; function getn(node1) {     textnodesunder(node1, text);     return text.join(""); } function textnodesunder(node1, text) {     if (node1.nodetype == 3) {         text.push(node1.innerhtml);         document.write(node1.textcontent + "<br>");     }     var children = node1.childnodes;     (var = 0; < children.length; i++) {         textnodesunder(children[i], text);     } } 

and

<body onload="alert('the document content ' + getn(document))" > 

at point node1 reference document object. indeed not have innerhtml property


Comments