I assume you're asking for the full HTML string. If that's the case, something like this will do the trick:
$('<div>').append($('#item-of-interest').clone()).html();
This is explained in more depth here, but essentially you make a new node to wrap the item of interest, do the manipulations, remove it, and grab the HTML.
If you're just after a string representation, then go with new String(obj)
.
Update
I wrote the original answer in 2009. As of 2014, most major browsers now support outerHTML
as a native property (see, for example, Firefox and Internet Explorer), so you can do:
$('#item-of-interest').prop('outerHTML');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…