Working with jQuery wrap function
<p>I am trying to wrap an input element with a div, and then append another element to the wrapping div.</p>

<p>Markup:</p>

<pre><code>&lt;div&gt;
    &lt;input type="text" id="foo" /&gt;
&lt;/div&gt;
</code></pre>

<p>JS:</p>

<pre><code>var wrapper = $('&lt;div class="wrapper"&gt;&lt;/div&gt;'),
somethingElse = $('&lt;div class="something-else"&gt;&lt;/div&gt;');

$('#foo').wrap(wrapper);
wrapper.append(somethingElse);
</code></pre>

<p>JSFiddle: <a href="http://jsfiddle.net/ckpeZ/" rel="nofollow">http://jsfiddle.net/ckpeZ/</a></p>

<p>The problem is the "somethingElse" div is not getting appended to wrapper. It is like the line <code>wrapper.append(somethingElse)</code> is completely ignored. What am I doing wrong?</p>
