Working together for standards The Web Standards Project

Shorter DOMScripting via Cloning vs. Generating New Elements?

By Christian Heilmann | January 6th, 2006 | Filed in DOM, DOM Scripting TF

Is cloning nodes quicker than generating new elements?

Skip to comment form

Writing some scripts I realised lately that a lot of times we repeat code over and over again, especially when we generate HTML – like list items with embedded links. I wondered if it wouldn’t make sense that instead of creating those where we need them in the script it’ll be more slick to create them once and clone them via cloneNode() later on.

Please check the relevant post about cloning vs. generating elements and give the test code a spin to see if you can find any bad issues I have overseen.

Return to top

Post a Reply

Comments are closed.

All of the entries posted in WaSP Buzz express the opinions of their individual authors. They do not necessarily reflect the plans or positions of the Web Standards Project as a group.

This site is valid XHTML 1.0 Strict, CSS | Get Buzz via RSS or Atom | Colophon | Legal