本文实例讲述了jQuery实现html表格动态添加新行的方法。分享给大家供大家参考。具体实现方法如下:
/p>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Add Row example$(document).ready(function () {
// Code between here will only run when the document is ready
$("a[name=addRow]").click(function() {
// Code between here will only run
//when the a link is clicked and has a name of addRow
$("table#myTable tr:last").after('
Row 4');return false;
});
});
Row 1 |
Row 2 |
Row 3 |
希望本文所述对大家的jQuery程序设计有所帮助。