Fetching contributors…
Cannot retrieve contributors at this time
20 lines (14 sloc) 551 Bytes
<script>{ "title": "Detach Elements to Work with Them", "level": "intermediate", "source": "", "attribution": [ "jQuery Fundamentals" ] }</script>

The DOM is slow; you want to avoid manipulating it as much as possible. jQuery introduced detach() in version 1.4 to help address this issue, allowing you to remove an element from the DOM while you work with it.

var table = $( "#myTable" );
var parent = table.parent();


// ... add lots and lots of rows to table

parent.append( table );