<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>Yeah you would use xpath instead of indexOf for innerHTML on the document.body.
I've taken sizzlemctwizzle's method and put it into a function if anyone needs a simple, quick way to search the html of the body...
&lt;pre&gt;// Search body's inner html
function searchDoc(t) {
	return document.evaluate(&amp;quot;//child::text()[contains(.,'&amp;quot;+t+&amp;quot;')]&amp;quot;,document,null,9,null).singleNodeValue!=null;
}&lt;/pre&gt;
Example:
&lt;code&gt;hello = searchDoc('Hello world') ? true : false;&lt;/code&gt;
Probably not best to search the innerHTML of a node when textContent is faster and will give you less hassle.
&lt;hr&gt;
&lt;em&gt;&amp;quot;None are more hopelessly enslaved than those who falsely believe they are free.&amp;quot;&lt;/em&gt; - &lt;b&gt;Johann Wolfgang von Goethe&lt;/b&gt;&lt;BR&gt;&lt;a href=&quot;http://www.tenfold.co.nr/&quot;&gt;My website&lt;/a&gt;</body>
  <body-html>Yeah you would use xpath instead of indexOf for innerHTML on the document.body.
I've taken sizzlemctwizzle's method and put it into a function if anyone needs a simple, quick way to search the html of the body...
&lt;pre&gt;// Search body's inner html
function searchDoc(t) {
	return document.evaluate(&amp;quot;//child::text()[contains(.,'&amp;quot;+t+&amp;quot;')]&amp;quot;,document,null,9,null).singleNodeValue!=null;
}&lt;/pre&gt;
Example:
&lt;code&gt;hello = searchDoc('Hello world') ? true : false;&lt;/code&gt;
Probably not best to search the innerHTML of a node when textContent is faster and will give you less hassle.
&lt;hr /&gt;&lt;em&gt;&amp;quot;None are more hopelessly enslaved than those who falsely believe they are free.&amp;quot;&lt;/em&gt; - &lt;b&gt;Johann Wolfgang von Goethe&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://www.tenfold.co.nr/&quot;&gt;My website&lt;/a&gt;</body-html>
  <created-at type="datetime">2008-12-20T23:29:24Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">85077</id>
  <topic-id type="integer">18247</topic-id>
  <updated-at type="datetime">2008-12-22T02:43:16Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">23652</user-id>
</post>
