<p>I have a dl containing some input boxes that I "clone" with a bit of JavaScript like:  </p>

<pre><code>var newBox = document.createElement('dl'); 
var sourceBox = document.getElementById(oldkey); 
newBox.innerHTML = sourceBox.innerHTML; 
newBox.id = newkey;          
document.getElementById('boxes').appendChild(columnBox);   
</code></pre>

<p>In IE, the form in sourceBox is duplicated in newBox, complete with user-supplied values.  In Firefox, last value entered in the orginal sourceBox is not present in newBox.  How do I make this "stick?"</p>

[{'answer_id': 69795, 'author': 'rpetrich', 'author_id': 4007, 'author_profile': 'https://Stackoverflow.com/users/4007', 'pm_score': 1, 'selected': False, 'text': "<p>You could try the <code>cloneNode</code> method. It might do a better job of copying the contents. It should also be faster in most cases</p>\n\n<pre><code>var newBox;\nvar sourceBox = document.getElementById(oldkey);\nif (sourceBox.cloneNode) \n    newBox = sourceBox.cloneNode(true);\nelse {\n    newBox = document.createElement(sourceBox.tagName); \n    newBox.innerHTML = sourceBox.innerHTML; \n}\nnewBox.id = newkey;              \ndocument.getElementById('boxes').appendChild(newBox);\n</code></pre>\n"}, {'answer_id': 70774, 'author': 'Nickolay', 'author_id': 1026, 'author_profile': 'https://Stackoverflow.com/users/1026', 'pm_score': 1, 'selected': True, 'text': '<p><a href="https://stackoverflow.com/questions/36778/firefox-vs-ie-innerhtml-handling#36793">Firefox vs. IE: innerHTML handling</a> ?</p>\n'}, {'answer_id': 80723, 'author': 'Ross Morrissey', 'author_id': 6997, 'author_profile': 'https://Stackoverflow.com/users/6997', 'pm_score': 1, 'selected': False, 'text': '<p>Thanks folks.  </p>\n\n<p>I got things to work by using <strong><a href="http://www.prototypejs.org/" rel="nofollow noreferrer" title="Prototype Javascript Framework">prototype</a></strong> and changing <code>document.getElementById(oldkey)</code>\nto <code>$(oldkey)</code>.</p>\n\n<pre><code>&lt;script src="j/prototype.js" type="text/javascript"&gt;&lt;/script&gt;  \n\nvar newBox;  \nvar sourceBox = $(oldkey);  \nif (sourceBox.cloneNode)  \n     newBox = sourceBox.cloneNode(true);  \nelse {  \n    newBox = document.createElement(sourceBox.tagName);  \n    newBox.innerHTML = sourceBox.innerHTML;  \n}  \nnewBox.id = newkey;  \ndocument.getElementById(\'boxes\').appendChild(newBox);\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/69722', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6997/']