<!DOCTYPE html>
<html>
<head>
<title> 事件</title>
<script type="text/javascript">
function count(){
var a1 = document.getElementById("text1".value);
var a2 = document.getElementById("text2".value);
var b1 = document.getElementById("fuhao".vaule);
var result = "";
switch(b1)
{
case "+";
result = a1 + a2;
break;
case "-";
result = a1 - a2;
break;
case "*";
result = a1 * a2;
break;
case "/";
result = a1 / a2;
break;
}
document.getElementById("fruit".vaule)=result;
</script>
</head>
<body>
<input type="text" id="test1">
<select id='fuhao'>
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="text" id="text2">
<input type="button" value="=" onclick="count()"/>
<input type="text" id="fruit" />
</body>
</html>