How to clone a <tr> element without data, but only structure using jQuery?

Is there a quick way to clone a <tr> element without its contents in cells? Basically, have a pure <tr> element having only the same structure as the original?

+7
source share
1 answer

If you need a deep clone of an element without textual content, you can write something like:

 var $cloned = $("tr").clone().children().text("").end(); 
+12
source

All Articles