I recently started working on cloning display objects.
I have observed there are basically two ways of cloning nodes:
1) I have tried cloning nodes with "cloneNode" method, which is pretty good but is not supported in old browsers.
var newNode = oldNode.cloneNode(deep);
2) For older browsers I am trying to copy outerHTML and set the value to the the innerHTML. Like
newNode.innerHTML = oldNode.outerHTML
NOTE:
For some old versions of internet explorer, innerHTML is a read-only property for table elements.
What is the best of the above methods or is there any other best method. Please help me.