<ul id="products">
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="401" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="联想G470AH-IFI 14.0英寸笔记本电脑" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="5" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:深棕色" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="4439" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="1091" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="美国森泰斯(sumdex)FullSpeed流线15.6寸电脑背包PON-372BK" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="undefined" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="218" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="404" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="戴尔Inspiron13Z 13英寸笔记本电脑" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:银色" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="4659" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
</ul>如上,如何通过jquery算出总金额呢?各个li下有单价和数量
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="401" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="联想G470AH-IFI 14.0英寸笔记本电脑" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="5" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:深棕色" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="4439" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="1091" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="美国森泰斯(sumdex)FullSpeed流线15.6寸电脑背包PON-372BK" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="undefined" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="218" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input id="proid" class="text_short ui-widget-content ui-corner-all" type="hidden" value="404" maxlength="15" name="proid">
<input id="proname" class="text_short ui-widget-content ui-corner-all" type="text" value="戴尔Inspiron13Z 13英寸笔记本电脑" maxlength="15" name="proname">
<input id="procount" class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input id="proprop" class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:银色" maxlength="15" name="proprop">
<input id="price" class="text_price ui-widget-content ui-corner-all" type="text" value="4659" maxlength="15" name="price">
<a class="remove" href="#nogo"> 删除</a>
</li>
</ul>如上,如何通过jquery算出总金额呢?各个li下有单价和数量
再就是容错这些东西你自己写<body>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2.min.js"></script><ul id="products">
<li>
<input class="text_short ui-widget-content ui-corner-all" type="hidden" value="401" maxlength="15" name="proid">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="联想G470AH-IFI 14.0英寸笔记本电脑" maxlength="15" name="proname">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="5" maxlength="15" name="procount">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:深棕色" maxlength="15" name="proprop">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="4439" maxlength="15" name="price">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="" maxlength="15" name="sum_price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input class="text_short ui-widget-content ui-corner-all" type="hidden" value="1091" maxlength="15" name="proid">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="美国森泰斯(sumdex)FullSpeed流线15.6寸电脑背包PON-372BK" maxlength="15" name="proname">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="undefined" maxlength="15" name="proprop">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="218" maxlength="15" name="price">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="" maxlength="15" name="sum_price">
<a class="remove" href="#nogo"> 删除</a>
</li>
<li>
<input class="text_short ui-widget-content ui-corner-all" type="hidden" value="404" maxlength="15" name="proid">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="戴尔Inspiron13Z 13英寸笔记本电脑" maxlength="15" name="proname">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="1" maxlength="15" name="procount">
<input class="text_short ui-widget-content ui-corner-all" type="text" value="颜色:银色" maxlength="15" name="proprop">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="4659" maxlength="15" name="price">
<input class="text_price ui-widget-content ui-corner-all" type="text" value="" maxlength="15" name="sum_price">
<a class="remove" href="#nogo"> 删除</a>
</li>
</ul>
<input type="button" value="计算" id="Cal"/><script type="text/javascript">
$("#Cal").click(function(){
$("#products li").each(function(){
$(":input[name=sum_price]",this).val(parseInt($(":input[name=procount]",this).val())*parseFloat($(":input[name=price]",this).val()))
})
});
</script>
$("html").click(function () {
$("#test:visible").hide();
});
});