 <p>Stolen from previous post: <a href="http://stackoverflow.com/questions/11984804/finding-untagged-elements-with-javascript">Finding untagged elements with javascript</a></p> <pre><code>var nodes = document.getElementsByTagName('body').childNodes for (i=0; i &lt; nodes.length; i++) { if(nodes.childNode[i].nodeType == 3) { //THIS NODE IS A TEXT NODE OF THE BODY ELEMENT //DO WHAT YOU NEED WITH IT } } </code></pre>