I've made this to try to extract text.\[code\]<script type = "text/javascript">function extractText(node){ var all = ""; for (node=node.firstChild;node;node=node.nextSibling){ alert(node.nodeValue + " = " + node.nodeType); if (node.nodeType == 3){ all += node.nodeValue } } alert(all);}</script>\[/code\]That is located in the head of an html document.The body looks as such...\[code\]<body onload = "extractText(document.body)">Stuff<b>text</b><script>var x = 1;</script></body>\[/code\]The problem is that the \[code\]alert(all);\[/code\] only shows "Stuff", and it adds a bunch of null things that I don't really understand when doing the \[code\]alert(node.nodeValue + " = " + node.nodeType);\[/code\]. It says null = 3 a few times. Could anyone tell me why this isn't working properly? Thanks in advance.