我该如何使用JavaScript计算unitprice数组中填充的值之和?
以下是我的HTML代码:
以下是我的HTML代码:
<td>
<input type="text" style="width: 60px; background: none repeat scroll 0% 0% rgb(255, 255, 255);" maxlength="4" id="unitprice" name="unitprice[]">
</td>
<td>
<input type="text" style="width: 60px; background: none repeat scroll 0% 0% rgb(255, 255, 255);" maxlength="4" id="unitprice" name="unitprice[]">
</td>
<input type="text" unitpricemarker="" name="unitprice"/>
,现在您可以使用jQuery选择所有这样的字段 -$('input[unitpricemarker]')
。 - AppleGrew