Select element based on EXACT text contents
<p>I have a list of divs that all contain a <code>p</code> tag classed as <code>index</code>. The textual content of these <code>p</code> tags is a number from 1 to <em>n</em> (although probably no more than maybe 30-40). I had the following selector, which worked fine in preliminary testing:</p>

<pre><code>var ad = $('.existing_ad .index:contains('+index+')').parents('.existing_ad');
</code></pre>

<p>Where <code>index</code> is the numeric index I retrieved from the <code>p</code> tag and <code>.existing_ad</code> is the class of the parent <code>div</code>. As I said, this worked fine... until I went with higher numbers. For instance, when the index is <strong>1</strong>, it selects the <code>.existing_ad</code>s where the index HAS A <strong>1</strong> IN IT, e.g. 1, 10-19, 21, 31, etc.</p>

<p><strong>How can I get ONLY index <em>n</em>?</strong></p>
