JavaScript
Result
Run
License
window.addEventListener("load", function() { let textNode1 = document.createTextNode("Hi"); let textNode2 = document.createTextNode("Everyone"); let elH1 = document.createElement("h1"); elH1.append(textNode1); elH1.append(textNode2); console.log("Length:" + elH1.childNodes.length); console.log(elH1.childNodes[0].textContent); console.log(elH1.childNodes[1].textContent); elH1.normalize(); console.log("---- After normalize -----"); console.log("Length:" + elH1.childNodes.length); console.log(elH1.childNodes[0].textContent); });
Console
expand_less
License
License
by DevDic
Close