DOM2 Reference |
[Back] | [Glossary] [Help] |
Source: | <div id="doc"></div> |
---|
JavaScript: | var main = document.getElementById('doc'); var output1 = main.childNodes.length; var textNode1 = document.createTextNode('This is some text.'); var textNode2 = document.createTextNode('This is another text.'); main.appendChild(textNode1); main.appendChild(textNode2); var output2 = main.childNodes.length; main.normalize(); var output3 = main.childNodes.length; |
---|
Output: |
|
---|
Remarks: |
|
---|