问题求解1

问题求解


在jQuery使用算法时,不出结果,总是出NaN!!!
改了好多次,快崩溃了~~~
下面是我的代码块
jQuery区域块

<script type="text/javascript">
function Sum(){
    var h1=document.getElementById("h1").value;
    var h2=document.getElementById("h2").value;
    var h3=document.getElementById("h3").value;
    var h4=document.getElementById("h4").value;
    var h5=document.getElementById("h5").value;
    s1=parseInt(h1)+parseInt(h2)+parseInt(h3)+parseInt(h4)+parseInt(h5);
    document.getElementById("sum1").innerHTML=s1;
}
</script>

body块

<tr>
<td>活期存款</td>
<td id="h1"><input  type="text" style="width:100%;height:100%" /></input></td>
<td><input  type="text" style="width:100%;height:100%" /></td>
</tr>  
<tr>
<td>定期存款</td>
<td id="h2"><input  type="text" style="width:100%;height:100%" /></input></td>
<td><input  type="text" style="width:100%;height:100%" /></td>
</tr>  
<tr>
<td>其他类型银行存款</td>
<td id="h3"><input  type="text" style="width:100%;height:100%" /></input></td>
<td><input  type="text" style="width:100%;height:100%" /></td>
</tr>  
<tr>
<td >货币市场基金</td>
<td id="h4"><input  type="text" style="width:100%;height:100%" /></input></td>
<td><input  type="text" style="width:100%;height:100%" /></td>
</tr>
<tr>  
<td >人寿保险金收入</td>
<td id="h5"><input  type="text" style="width:100%;height:100%" /></input></td>
<td><input  type="text" style="width:100%;height:100%" /></td>
</tr>  
<tr>
<td id="d1"colspan="2"  style="text-align: center">现金与现金等价物小计</td>
<td id="sum1" onclick="Sum()"> </td>
<td><input  type="text" style="width:100%;height:100%" /> </td>
</tr>

求各位大神,帮忙找错误!

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值