HTML和JavaScript动态表的问题 [英] Problems with HTML and javascript dynamic table

查看:148
本文介绍了HTML和JavaScript动态表的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下问题:1)saveRow函数不保存行。我得到这个错误: Uncaught TypeError:不能在saveRow的HTMLInputElement.onclick 处设置undefined的属性名称。 2) deleteRow 不起作用。我得到一个类似的错误: Uncaught TypeError:无法设置属性'innerHTML'为null 。 3)在editRow中,我的字段变得可编辑,但使用之前保存的默认值。例如,列表总是A,B,C,这不是我想要的。我希望列表的初始值是之前选择的值。
我正在做的事情应该是错的。这里是代码:

HTML:

 < html> 

< head>
< / head>

< body>
< div id =wrapper>
< thead>
< tr>
< th>名称< / th>
< th> Level< / th>
< th>动作< / th>
< / tr>
< / thead>
< tbody id =table-rows>
< tr>
< td>< input type =textid =name-text>< / td>
< td>
发送“验证码”获取 | 15天全站免登陆