简体   繁体   中英

Appending rows to tables with prototype

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM