在表格的第一行上方添加新行

Pra*_*nna 1 javascript jquery dom

我有一张12列的桌子。每列将有一个文本框。When I click on an 'Add' button, a new row should be inserted above the first row of the table。我该怎么办?说,如果我使用jquery append(),它将仅在最后添加行,但我想在第一行的顶部添加。

Sur*_*tta 5

尝试

$("#tableId tbody").prepend("<tr>..</tr>");
Run Code Online (Sandbox Code Playgroud)