大神们,我的为什么点=没反应啊,
<!DOCTYPE html>
<html>
<head>
<title> 事件</title>
<script type="text/javascript">
function count(){
var x=document.getElementById("text1").value;
var y=document.getElementById("text2").value;
var z=document.getElementById("select").value;
var n;
switch(z){
case '+': n=parseInt(x)+parseInt(y);break;
case "-": n=parseInt(x)-parseInt(y);break;
case "*": n=parseInt(x)*parseInt(y);break;
case "/": n=parseInt(x)/parseInt(y);break;
default: break;
}
document.getElementById("text3").value=n;
}
</script>
</head>
<body>
num1
<input type='text' id='text1'/>
<select>
<option value='+'>+</option>
<option value='-'>-</option>
<option value='*'>*</option>
<option value='/'>/</option>
</select>
num2
<input type='text' id='text2'/>
<input type='button' value ='=' onclick="count()"/>
<input type='text' id ='text3'/>
</body>
</html>