0

I try to clone a row and then append it as below :-

codeTable.$("tr:first").clone().appendTo(codeTable);

The code successfully clones and appends the <tr> element. But when I try to select with Jquery, the new element is not included on the result.

codeTable.$('tr');
mithilatw
  • 908
  • 1
  • 10
  • 29
Azri Jamil
  • 2,394
  • 2
  • 29
  • 37

1 Answers1

2

You can try:

codeTable.find("tr:first").clone().appendTo(codeTable);

and to get tr:

$(codeTable).find('tr');

or

$('tr', codeTable);

Where I assume codeTable is jQuery object. If not then wrap it within $() like $(codeTable).

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164