<p>hello</p>
$("p").wrap("<div class='inner'></div>").wrap("<div class='outer'></div>");
The result is <div class="inner"><div class="outer"><p>hello</p></div></div>
,
Why is it so? I expected inner inside outer, not otherwise.
Here is fiddle to play with : http://jsfiddle.net/qnYDY/