for (var i in checkedBoxIds) { var $td = $("#" + checkedBoxIds[i]).parent().parent().detach(); $('#table-selected').append($td); }