I got a table in my HTML and I want to generate new temporary HTML only with this table. How can I achieve it with HTML or JavaScript?
Asked
Active
Viewed 303 times
1
-
if someone is interested in results than: Table cloning used from nemo's answer, and for temporary HTML creation used [this](http://stackoverflow.com/questions/1750815/get-the-string-representation-of-a-dom-node) answer – Kiman Jul 03 '12 at 10:38
1 Answers
2
var tempTable = document.getElementById("myTableId").cloneNode(true);
Where myTableId is the id of the table you want to clone. Then you can append your tempTable wherever you want(using appendChild )

nemo
- 1,675
- 10
- 16
-
Thanks, definitely will use this, now I have to figure out how to make temporary HTML – Kiman Jul 03 '12 at 08:05