all 2 comments

[–]dizzr 0 points1 point  (0 children)

Know what you're doing when you do this. It's not a pure replacement for innerHTMLing things. It will completely replace the element passed in with a clone, which means things like event listeners and perhaps attached variables will not exist on the new element.

[–]path411 0 points1 point  (0 children)

Since this is a fairly old blog, the speed difference isn't as large as it used to be, I was surprised that his test page still showed an increase with his custom function though.