<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<title>?計算器</title>
<script?type="text/javascript">
function?ys(){
var?y=document.getElementById("yi").value;
var?e=document.getElementById("er").value;
var?ee=document.getElementById("dd").value;
var?s="";
switch(ee)
{
case?"加":
?s=parseInt(y)+parseInt(e);
?break;
?case"減":
?s=parseInt(y)-parseInt(e);
?break;
case"乘":
s=parseInt(y)*parseInt(e);
break;
default:
s=parseInt(y)/parseInt(e);
}
document.getElementById("san").value=s;
}
</script>
</head>
<body>
<input?id="yi"?type="text"?/>
????<select?id="dd">
??????<option?value="加">+</option>
??????<option?value="減">-</option>
??????<option?value="乘">*</option>
??????<option?value="除">/</option>
????</select>
<input?id="er"?type="text"?/>
<input?value="="?type="button"?onclick="ys()"?/>
<input?id="san"?type="text"?/>
</body>
</html>
求教 哪里出錯了
慕粉4062053
2016-12-03 21:36:00