I have to clone some table rows. I only can select this rows based on their indexes. I can’t use any common class or attribute to select the rows in one shot.
I do this like this:
const rows: JQuery<HTMLElement>[] = [];
for (let i = 0; i <= rowIndexes!.length - 1; i++) {
const row = $(
`tr[ng-reflect-data-row-index='${rowIndexes![i]}'`
);
rows.push(row);
}
And after this I want to clone the rows
array like this:
$(rows).clone()
But with this I get the error TypeError: e.cloneNode is not a function
.
So, the question is, how can I clone this array as a jquery element? After clone I want to do some other operations on it, f.e. animate
, wrapAll
.
Thanks.