S
superyang
Unregistered / Unconfirmed
GUEST, unregistred user!
<script>
function Chgjj1()
{
document.fresume.jj1.value=parseFloat(document.fresume.jj11.value)
+parseFloat(document.fresume.jj21.value)+parseFloat(document.fresume.jj31.value)
+parseFloat(document.fresume.jj41.value)+parseFloat(document.fresume.jj51.value)
+parseFloat(document.fresume.jj61.value)+parseFloat(document.fresume.jj71.value)
+parseFloat(document.fresume.jj81.value)+parseFloat(document.fresume.jj91.value)
+parseFloat(document.fresume.jj101.value)+parseFloat(document.fresume.jj111.value)
+parseFloat(document.fresume.jj121.value)+parseFloat(document.fresume.jj131.value)
+parseFloat(document.fresume.jj141.value)+parseFloat(document.fresume.jj151.value)
+parseFloat(document.fresume.jj161.value);
}
</script>
<form name=fresume>
1<input type=text name=jj1><br>
11<input type=text name="jj11" value=0 onChange="javascript:Chgjj1();"><br>
21<input type=text name="jj21" value=0 onChange="javascript:Chgjj1();"><br>
31<input type=text name="jj31" value=0 onChange="javascript:Chgjj1();"><br>
41<input type=text name="jj41" value=0 onChange="javascript:Chgjj1();"><br>
51<input type=text name="jj51" value=0 onChange="javascript:Chgjj1();"><br>
61<input type=text name="jj61" value=0 onChange="javascript:Chgjj1();"><br>
71<input type=text name="jj71" value=0 onChange="javascript:Chgjj1();"><br>
81<input type=text name="jj81" value=0 onChange="javascript:Chgjj1();"><br>
91<input type=text name="jj91" value=0 onChange="javascript:Chgjj1();"><br>
101<input type=text name="jj101" value=0 onChange="javascript:Chgjj1();"><br>
111<input type=text name="jj111" value=0 onChange="javascript:Chgjj1();"><br>
121<input type=text name="jj121" value=0 onChange="javascript:Chgjj1();"><br>
131<input type=text name="jj131" value=0 onChange="javascript:Chgjj1();"><br>
141<input type=text name="jj141" value=0 onChange="javascript:Chgjj1();"><br>
151<input type=text name="jj151" value=0 onChange="javascript:Chgjj1();"><br>
161<input type=text name="jj161" value=0 onChange="javascript:Chgjj1();"><br>
</form>
代码如上,求jj11至jj161的和,显示在jj1中,但是有错误。
举例来说,jj11至jj161全部输入0.9,则jj1中显示的是14.400000000000004。
这是为什么,为什么,为什么。
在线等待大侠解难。。。。。。
function Chgjj1()
{
document.fresume.jj1.value=parseFloat(document.fresume.jj11.value)
+parseFloat(document.fresume.jj21.value)+parseFloat(document.fresume.jj31.value)
+parseFloat(document.fresume.jj41.value)+parseFloat(document.fresume.jj51.value)
+parseFloat(document.fresume.jj61.value)+parseFloat(document.fresume.jj71.value)
+parseFloat(document.fresume.jj81.value)+parseFloat(document.fresume.jj91.value)
+parseFloat(document.fresume.jj101.value)+parseFloat(document.fresume.jj111.value)
+parseFloat(document.fresume.jj121.value)+parseFloat(document.fresume.jj131.value)
+parseFloat(document.fresume.jj141.value)+parseFloat(document.fresume.jj151.value)
+parseFloat(document.fresume.jj161.value);
}
</script>
<form name=fresume>
1<input type=text name=jj1><br>
11<input type=text name="jj11" value=0 onChange="javascript:Chgjj1();"><br>
21<input type=text name="jj21" value=0 onChange="javascript:Chgjj1();"><br>
31<input type=text name="jj31" value=0 onChange="javascript:Chgjj1();"><br>
41<input type=text name="jj41" value=0 onChange="javascript:Chgjj1();"><br>
51<input type=text name="jj51" value=0 onChange="javascript:Chgjj1();"><br>
61<input type=text name="jj61" value=0 onChange="javascript:Chgjj1();"><br>
71<input type=text name="jj71" value=0 onChange="javascript:Chgjj1();"><br>
81<input type=text name="jj81" value=0 onChange="javascript:Chgjj1();"><br>
91<input type=text name="jj91" value=0 onChange="javascript:Chgjj1();"><br>
101<input type=text name="jj101" value=0 onChange="javascript:Chgjj1();"><br>
111<input type=text name="jj111" value=0 onChange="javascript:Chgjj1();"><br>
121<input type=text name="jj121" value=0 onChange="javascript:Chgjj1();"><br>
131<input type=text name="jj131" value=0 onChange="javascript:Chgjj1();"><br>
141<input type=text name="jj141" value=0 onChange="javascript:Chgjj1();"><br>
151<input type=text name="jj151" value=0 onChange="javascript:Chgjj1();"><br>
161<input type=text name="jj161" value=0 onChange="javascript:Chgjj1();"><br>
</form>
代码如上,求jj11至jj161的和,显示在jj1中,但是有错误。
举例来说,jj11至jj161全部输入0.9,则jj1中显示的是14.400000000000004。
这是为什么,为什么,为什么。
在线等待大侠解难。。。。。。