Traversing a JQuery object and replacing text
<p>Assuming I have the following html div which I want to replicate its children, changing the value of each span in the process</p>

<pre><code>&lt;div&gt;&lt;span class="foo"&gt;[Name]&lt;/span&gt; &lt;span class="bar"&gt;[Name]&lt;/span&gt;&lt;/div&gt;
</code></pre>

<p>Using jQuery I can get a reference to the "div" by</p>

<pre><code>var $div = $("div");
</code></pre>

<p>and then clone as in</p>

<pre><code>var clone = $div.children().clone();
</code></pre>

<p>How can I then traverse the clone and change the values for each span?</p>
