var c = document.getElementById('test').cloneNode(true); document.getElementById('post').appendChild(c);
I don't have my usual compliment of browsers installed for testing though it looks like it's pretty well supported. This will become part of an advanced feature which won't be available to people with outdated browsers any way.
I don't suppose anyone knows what version of ECMAScript or the DOM this belongs to by chance?
var s = new XMLSerializer(); var str = s.serializeToString(document); alert(str);
[edited by: JAB_Creations at 11:38 pm (utc) on Jul 9, 2011]
XMLSerializer is mainly useful for applications and extensions based on the Mozilla platform. While it is available for web pages, it's not part of any standard and level of support in other browsers unknown.
Thanks coopster, that is actually where I found the answer I was looking for. I've been installing older versions of browsers to test how far back it's supported and I'm glad to say far back. There are proprietary methods for IE8 and older here...