javascript购物车计算价格 10
展开全部
获取小计下面相对应得value值,再相加!
<div id="one">1.5</div>
<div id="two">2.5</div>
<div id="three"></div>
<script>
var one=document.getElementById("#one").value;
var two=document.getElementById("#two").value;
var three=document.getElementById("#three").value;
three=one+two;
</script>
<div id="one">1.5</div>
<div id="two">2.5</div>
<div id="three"></div>
<script>
var one=document.getElementById("#one").value;
var two=document.getElementById("#two").value;
var three=document.getElementById("#three").value;
three=one+two;
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询