This is due to the javascript cloneNode issue and properties .
I see the same behavior. Node.cloneNode does not copy any properties that I add (code from the original message):
var theSource = document.getElementById("someDiv")
theSource.dictator = "stalin";
var theClone = theSource.cloneNode(true);
alert(theClone.dictator);
theClone does not contain any dictator property.
I could not find an explanation of why this is so. The documentation in MDN claims to cloneNode“copy all its attributes and their values,” a string that is taken directly from the DOM specification itself .
This seems broken to me because it makes it impossible to make a deep copy of the DOM tree containing custom properties.
Did I miss something?
source