菜菜问题,大家帮帮忙看看要怎么改???
功能其实很简单啦,但为什么我这样写不行呢???
<html>
<head>
<script language>
function calc(theForm,theText){
var totalText = parseFloat(document.forms(theForm).elements('total').value);
var textValue = parseFloat(theText.value);
totalText += textValue;
document.all('total').value = totalText;
}
</script>
</head>
<body>
<form method="POST" name="f_count">
<p><input type="text" name="T1" onchange="calc('f_count',this)" size="20"><br>
+<br>
<input type="text" name="T2" onchange="calc('f_count',this)" size="20"><br>
+<br>
<input type="text" name="T4" onchange="calc('f_count',this)" size="20"><br>
=<br>
<input type="text" name="total" size="20"></p>
</form>
</body>
</html>