title: how to wrap jquery html object variable
body: <p>I'm having an issue with html object variable   </p>
  
  <pre><code>var loading = $('&lt;div class="loading" style="display:none"&gt;loading...&lt;/div');
  </code></pre>
  
  <p>later on I need to wrap the object in another div with some custom styles</p>
  
  <pre><code>var animateWrapper = $('&lt;div style="width:' + elwidth + '; position:absolute; top:'+elPos.top+'; left:' + elPos.left + '"&gt;' + loading.html() + '&lt;/div&gt;');
  </code></pre>
  
  <p>Irregardless of whether I declare <code>animaterWrapper</code> and then append <code>loading</code> or or try wrapping <code>loading.wrap()</code> with the wrapper div where loading should be is always empty.</p>
  
  <p>How do I achieve this?</p>