最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Appending rows to tables with prototype - Stack Overflow

programmeradmin2浏览0评论

How do I append a row to a table using the prototype library.

This is part of a form so I would like to also find a way to increment the <input name="container[0]"> value. Is this possible?

How do I append a row to a table using the prototype library.

This is part of a form so I would like to also find a way to increment the <input name="container[0]"> value. Is this possible?

Share Improve this question edited Dec 29, 2011 at 15:42 Rob W 349k87 gold badges807 silver badges682 bronze badges asked Oct 23, 2009 at 20:05 vicTROLLAvicTROLLA 1,52912 silver badges16 bronze badges 1
  • oh it chopped out my html. I want to increment the name="inputname[0]" portion of an input tag within the row. – vicTROLLA Commented Oct 23, 2009 at 20:08
Add a ment  | 

1 Answer 1

Reset to default 7

if i understand you right something like this would work:

var numrows = $$('#tableid tr').length;
$('tableRow').insert({after:'<tr><td><input type="text" name="container['+numrows+']"></td></tr>'});

if you can provide more details then i'll be able to help out a bit more

发布评论

评论列表(0)

  1. 暂无评论