87,955
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
<body>
<div id="dv">
<form id="submitForm">
<table border="1" align="center" width="500" id="myTable">
<tr>
<td width="300">product</td>
<td width="300">number</td>
</tr>
</table>
<input type="button" value="add" onclick="addTable();">
<input type="button" value="submit" onClick="submit();">
</form>
</div>
</body>
var num = 0;
function addTable()
{
var a = "";
a += '<tr id="tr'+num+'">'
+ '<td><input class="addtd" id="beverage'+num+'" type="text" name="beverage"/></td>'
+ '<td><input class="addtd" id="number'+num+' "type="text" name="number"/></td>'
+ '<td><input type="button" value="save" onClick="save('+num+');">'
+ '</td></tr>';
d.innerHTML = d.innerHTML + a;
$("myTable").append(a);
num++;
}