jQuery: Create an element inside another created element
<p>In the following string, I'm trying to add an additional span around the <code>post.caption</code> but keep it inside the <code>&lt;span class="overlay" /&gt;</code>. I've tried prepend and wrap before and after the .html, but can't get it or anything to do it correctly.</p>

<p><code>$('&lt;span class="overlay" /&gt;').html(post.caption).appendTo(entry);</code></p>

<p>Result would look like <code>&lt;span class="overlay"&gt;&lt;span&gt;Caption content&lt;/span&gt;&lt;/span&gt;</code></p>

<p>Here's the full snippet if that helps:</p>

<pre><code>entry = $('&lt;a /&gt;').attr('href', post.permalinkFull)
        $('&lt;img /&gt;').attr('src', post.image).appendTo(entry)
        $('&lt;span class="overlay" /&gt;').html(post.caption).appendTo(entry);
</code></pre>

<p>Any help would be hugely appreciated!</p>
