87,964
社区成员
发帖
与我相关
我的任务
分享
<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++;
}