HTML5 web sql: adding button to each row

I have some script that is delivering a series of rows from an SQL database. I want to append.() a button to each row. My current code is: tx.executeSql('SELECT * FROM myprogram', [], function (tx, results) { var len = results.rows.length, i; for (i = 0; i < len; i++) { $('#myprog').append(results.rows.item(i).event) $('.event').append(''); } }); But the buttons get doubled up. For example if I get 3 rows, the first row will have 3 buttons, the 2nd will have 2 and the last will have 1 button. Can anyone help me out to have the buttons display only once per row? Thanks!

以上就是HTML5 web sql: adding button to each row的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏