JSFiddle - React, Tailwind, and code Playground
by dmethvin
HTML
<div>
<button id="method2">breaks</button>
<button id="method1">works</button>
</div>
<table id="tbl">
<tr>
<td>
<input type="text"/>
</td>
</tr>
</table>
JavaScript
$("#method2").click(function () {
// Breaks
var tbl = $("#tbl")[0];
var arr = [ $(tbl.rows[tbl.rows.length - 1]).clone() ];
$(tbl).append($(arr));
});
$("#method1").click(function () {
// Works
var tbl = $("#tbl")[0];
var arr = [ $(tbl.rows[tbl.rows.length - 1]).clone() ];
$(tbl).append(arr);
});