adding classes to children
<p>When I do 
<code>$('ul.latestnews ul li').parent().prev().text());</code> I get back the content of the targeted li. (word1 or word2 in this example).</p>

<p>But when I do </p>

<pre><code>$('ul.latestnews ul li').addClass($(this).parent().prev().text());
</code></pre>

<p>It doesn't add the class. When I do a console.log on that last statement it just returns all the li's I am trying to add the class to.</p>

<p>What I am trying to do is this:</p>

<pre><code>&lt;ul class="latestnews"&gt;
    &lt;li&gt;word1&lt;/li&gt;
    &lt;ul&gt;
        &lt;li&gt;my class should become word1&lt;/li&gt;
        &lt;li&gt;my class should become word1&lt;/li&gt;
    &lt;/ul&gt;
    &lt;li&gt;word2&lt;/li&gt;
    &lt;ul&gt;
        &lt;li&gt;my class must become word2&lt;/li&gt;
    &lt;/ul&gt;        
&lt;/ul&gt;
</code></pre>

<p>Where did I go wrong? </p>
