title: jQuery wrap syntax
body: <p>It's end of day. I'm hoping I'm just having a lapse of logic.</p>
  
  <p>I can't get this to work:</p>
  
  <pre><code>var $divA= $("&lt;div&gt;&lt;/div&gt;").addClass('classA');
  
  var $divB= $("&lt;div&gt;&lt;/div&gt;").addClass('classB');
  
  $myDiv.after($divA.wrap($divB));
  </code></pre>
  
  <p>The above should turn this:</p>
  
  <pre><code>&lt;div id="myDiv"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Into this:</p>
  
  <pre><code>&lt;div id="myDiv"&gt;&lt;/div&gt;
  &lt;div class="classB"&gt;
      &lt;div class="classA"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But it doesn't seem to work with that 'wrap' in there. I don't get any errors, it just doesn't wrap divA with divB and just inserts divA by itself.</p>
  
  <p>Am I misunderstanding wrap? </p>
  
  <p>UPDATE:</p>
  
  <p>A simpler example that does not work:</p>
  
  <pre><code>$myBox.after($("&lt;p&gt;&lt;/p&gt;").wrap("&lt;div&gt;&lt;/div&gt;"));
  </code></pre>
  
  <p>That will add just the DIV after myBox. </p>
  
  <p>It seems like jQuery doesn't like wrap added to after. </p>