how remove html table rows after 2nd row? if in table have 5 row, 1 and 2 are safe, 3,4,5 must be remove
+1
A:
Use detach() instead of remove()
var myremovedElems = $("#table tr:gt(1)").detach();
The .detach() method is the same as .remove(), except that .detach() keeps all jQuery data associated with the removed elements. This method is useful when removed elements are to be reinserted into the DOM at a later time.
rahul
2010-03-05 09:48:14
thanks @rahul, detach function is new for me...
loviji
2010-03-05 10:50:48