Wrap a span around all children
<p>I am trying to get the contents of a div and wrap a span around it and append back to the div.</p>

<p>From this:</p>

<pre><code>&lt;div&gt;
&lt;a href="#"&gt;12&lt;/a&gt;
Testing
&lt;/div&gt;
</code></pre>

<p>To this:</p>

<pre><code>&lt;div&gt;
&lt;span&gt;
&lt;a href="#"&gt;Hehhehe&lt;/a&gt;
Testing
&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>So I tried this:</p>

<pre><code>var span = $(document.createElement('span'));

var contents = window.jQuery(this).children();

span.append(contents);

window.jQuery(this).append(span); // I am looping here but this is the div
</code></pre>

<p>However, the text "Testing" is always outside the span!</p>

<p>How can I get everything to be within the span?</p>
