日期:2014-05-16  浏览次数:20393 次

数组相加获得运算结果
<input   name= "fee() "> <input   name= "fee1() "> <input   name= "fee2() ">
<input   name= "fee() "> <input   name= "fee1() "> <input   name= "fee2() ">

fee()=fee1()+fee2()
这个用javascript怎么写,笨的不行,大家帮帮我。

------解决方案--------------------
...这样啊,呵呵稍微该一下啊
<HTML>
<BODY>
<input name= "fee "> <input name= "fee1 "> <input name= "fee2 ">
<SCRIPT LANGUAGE= "JavaScript ">
document.all.fee1.onpropertychange=function(){
test();
}
document.all.fee2.onpropertychange=function(){
test();
}
function test(){
document.all.fee.value=parseFloat(document.all.fee1.value)+parseFloat(document.all.fee2.value);
}
</SCRIPT>
</BODY>
</HTML>