jQuery wrapAll not behaving as expected
<p>I am trying to wrap a generated series of elements that are created on the fly with another element, for example:</p>

<pre><code>var innerHtmlAsText = "&lt;li&gt;test1&lt;/li&gt;&lt;li&gt;test2&lt;/li&gt;";
var wrapper = "&lt;ul /&gt;";

$("div#target").append($(innerHtmlAsText).wrapAll(wrapper));
</code></pre>

<p>My expected result is</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;test1&lt;/li&gt;
    &lt;li&gt;test2&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>But the actual result is:</p>

<pre><code>&lt;li&gt;test1&lt;/li&gt;
&lt;li&gt;test2&lt;/li&gt;
</code></pre>

<p>The <code>li</code> elements are not wrapped. In my instance the innerHtml is generated on the fly from a user generated template and the wrapper is supplied separately. How can I get the inner values wrapped?</p>
