I have the following JavaScript code:
function addRowToTable() { var tbl = document.getElementById(\'tblSample\'); var lastRow = tbl.rows.length; // if
I would avoid using strings of HTML and keep creating DOM elements like you had before. jQuery makes this really easy:
var row = $(""); row.append( $("").text("hello") ); $("#tblSample").append(row); See http://api.jquery.com/jQuery/#jQuery2 for more info. 0 讨论(0) 查看其它3个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
See http://api.jquery.com/jQuery/#jQuery2 for more info.