Hacker News new | ask | show | jobs
by joestelmach 5171 days ago
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
1 comments

Seems like a reasonable solution.

My 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:

http://www.quirksmode.org/dom/innerhtml.html

I'm only disagreeing with the use of the word 'performant', and the popular viewpoint that any solution that isn't as fast as possible can't be labeled as such.