How do I use JQuery to do this? (Loop through the classes)
<p>Suppose my code is like this:</p>

<pre><code>&lt;td class="apple"&gt;
&lt;div class="worm"&gt;
text1
&lt;/div&gt;
&lt;/td&gt;

&lt;td class="apple"&gt;
&lt;div class="worm"&gt;
text2
&lt;/div&gt;
&lt;/td&gt;

&lt;td class="apple"&gt;
&lt;div class="worm"&gt;
text3
&lt;/div&gt;
&lt;/td&gt;
</code></pre>

<p>How can I loop through everything with "td class apple", and then grab the text of the div inside with id "worm", and then set each of the .attr() as that text?</p>

<p>Result:</p>

<pre><code>&lt;td class="apple" title="text1"&gt;
&lt;div class="worm"&gt;
text1
&lt;/div&gt;
&lt;/td&gt;

&lt;td class="apple" title="text2" &gt;
&lt;div class="worm"&gt;
text2
&lt;/div&gt;
&lt;/td&gt;

&lt;td class="apple" title="text3"&gt;
&lt;div class="worm"&gt;
text3
&lt;/div&gt;
&lt;/td&gt;
</code></pre>

<p>Thank you</p>
