javascript cloneNode and properties
问题 Is there a quick way to "super" deep clone a node, including its properties? (and methods, I guess) I've got something like this: var theSource = document.getElementById("someDiv") theSource.dictator = "stalin"; var theClone = theSource.cloneNode(true); alert(theClone.dictator); The new cloned object has no dictator property. Now, say I've got a thousand properties attached to theSource - how can I (non-explicitly) transfer/copy them to the clone? // EDIT @Fabrizio Your hasOwnProperty answer