开发者

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

开发者 https://www.devze.com 2023-03-10 02:37 出处:网络
Is there a quick way to clone a <t开发者_如何学编程r> element without its content in cells? Basically to have a pure <tr> element having only the same structure as the original?If you want

Is there a quick way to clone a <t开发者_如何学编程r> element without its content in cells? Basically to have a pure <tr> element having only the same structure as the original?


If you want a deep clone of the element without the text content, you can write something like:

var $cloned = $("tr").clone().children().text("").end();
0

精彩评论

暂无评论...
验证码 换一张
取 消