Jquery: Checking to see if div contains text, then action
<p>I'm trying to check in jquery if a div contains some text, and then add a class if it does.</p>

<p>So I wrote something like this:</p>

<pre><code>    if( $("#field &gt; div.field-item").text().indexOf('someText') = 0) {
        $("#somediv").addClass("thisClass");
    }
</code></pre>

<p>I'm not getting this to work.</p>

<pre><code>&lt;div id="field"&gt;&lt;div class="field-item"&gt;someText&lt;/div&gt;&lt;/div&gt;

&lt;div id="somediv"&gt;&lt;/div&gt;
</code></pre>

<p>Is this incorrect? </p>

<p>Thanks.</p>
