jquery dynamically change class
<p>When i do console log following is the html structure, that is printed:</p>

<pre><code>&lt;div class="ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" data-id="21"&gt;
          &lt;div class="ui-widget-header ui-corner-all"&gt;
             &lt;span class="ui-icon ui-icon-minusthick"&gt;&lt;/span&gt;
             &lt;h6&gt;First Person&lt;/h6&gt;
          &lt;/div&gt;
          &lt;p class="style-content"&gt;&lt;/p&gt;
          &lt;p class="style-content"&gt;Estimated Missing: 10&lt;/p&gt;
          &lt;p class="style-content"&gt;
            &lt;span class="sub_task"&gt;6&lt;/span&gt; 
            People Found
          &lt;/p&gt;
        &lt;/div&gt;
</code></pre>

<p>I want to add additional class <code>delta</code> to <code>&lt;span class="sub_task"&gt;6&lt;/span&gt;</code> if a given variable <code>alpha = "12"</code></p>

<p>As of now my js file looks like this:</p>

<pre><code>console.log(elem)
elem = $(this).children()[3];
if (alpha=="12"){
elem.addClass("delta");
}
</code></pre>

<p>but this gives an error:</p>

<pre><code>Uncaught TypeError: Object #&lt;HTMLParagraphElement&gt; has no method 'addClass' 
</code></pre>

<p>I have two questions:</p>

<p>a better selector to get the element.</p>

<p>how can i add the class?</p>
