While I don't entirely agree with your first statement, you could just grab the outerHTML instead of appending the element directly to the DOM:
$.el.div($.el.span()).outerHTML $.el.div($.el.span()).outerHTMLMy first statement was certainly true in the previous generation of browsers, including IE 7. I'm not sure about more modern browsers. What basis do you have for disagreeing?
Refer to: