Using :contains to find a particular td element
<p>I have the following rendered html:</p>

<pre><code>&lt;table width="420" cellspacing="0" cellpadding="3" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;....&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total Amount Due:&lt;/td&gt;
&lt;td&gt;$168.88&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>My final goal is to obtain and change the value shown after Total Amount Due. I have started by trying to select the element containing the text "Total Amount Due:".</p>

<p>Here is my code attempting this:</p>

<pre><code>var tdElement = $("td:contains('Total Amount Due:')");
alert($(tdElement).text());
</code></pre>

<p>I have tried changing the syntax a bit in the command line of Firebug, but when I do I always end up receiving an error in the first line. With the code like this, I do not receive an error until the second line where I get a TypeError: $(tdElement) is null.</p>

<p>Also, not sure if this affects anything but this table is actually within two other tables.</p>
