jQuery has nothing in its API for this, but you can use your own .outerHTML property.
$content[0].outerHTML
... but Firefox does not support this, so you can do something like this ...
$content[0].outerHTML || $('<div>').append($content.clone()).html();
http://jsfiddle.net/m22fn/
Note that the <div> does not close on its own.
user1106925
source share