问题求解
在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>
求各位大神,帮忙找错误!