以下JavaScript支持IE不支持火狐、360、、、求解?
<html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>无...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language = "JavaScript">
function add(){
ye1=Number(document.myform.text1.value);
ye2=Number(document.myform.text2.value);
ye3=Number(document.myform.text3.value);
ye4=Number(document.myform.text4.value);
document.myform.score.value=ye1+ye2+ye3+ye4;
}
</script>
</head>
<body>
<form name="myform" method="post" action="">
<input name="text1" type="text" class="inputnumtext" id="text1" size="5" maxlength="5" onpropertychange=add()>
<input name="text2" type="text" class="inputnumtext" id="text2" size="5" maxlength="5" onpropertychange=add()>
<input name="text3" type="text" class="inputnumtext" id="text3" size="5" maxlength="5" onpropertychange=add()>
<input name="text4" type="text" class="inputnumtext" id="text4" size="5" maxlength="5" onpropertychange=add()>
总分:
<input name="score" type="text" class="inputtext" id="score" size="5" maxlength="5" readonly=true>
</form>
</body>
</html> 展开
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language = "JavaScript">
function add(){
ye1=Number(document.myform.text1.value);
ye2=Number(document.myform.text2.value);
ye3=Number(document.myform.text3.value);
ye4=Number(document.myform.text4.value);
document.myform.score.value=ye1+ye2+ye3+ye4;
}
</script>
</head>
<body>
<form name="myform" method="post" action="">
<input name="text1" type="text" class="inputnumtext" id="text1" size="5" maxlength="5" onpropertychange=add()>
<input name="text2" type="text" class="inputnumtext" id="text2" size="5" maxlength="5" onpropertychange=add()>
<input name="text3" type="text" class="inputnumtext" id="text3" size="5" maxlength="5" onpropertychange=add()>
<input name="text4" type="text" class="inputnumtext" id="text4" size="5" maxlength="5" onpropertychange=add()>
总分:
<input name="score" type="text" class="inputtext" id="score" size="5" maxlength="5" readonly=true>
</form>
</body>
</html> 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询