我的代码哪里出错了,为什么运行出来只有除法运算?
<!DOCTYPE html>
<html>
<head>
<title>运算</title>
<meta http-equiv="content-type" content="text/html,charset=utf-8">
<script type="text/javascript">
function count()
{
var a=document.getElementById("in1").value;
var b=document.getElementById("in2").value;
var c=document.getElementById("in3").value;
var rusult="";
switch("b")
{
case "+":
result = parseFloat(a) + parseFloat(c);
break;
case "-":
result = parseFloat(a) - parseFloat(c);
break;
case "*":
result = parseFloat(a) * parseFloat(c);
break;
default:
result = parseFloat(a) / parseFloat(c);
}
document.getElementById("in5").value=result;
}
</script>
</head>
<body>
<input id="in1" type="text">
<select id='in2'>
<option value='+'>+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input id="in3" type="text">
<input id="in4" type="button" value="=" onclick=count()>
<input id="in5" type="text">
</body>
</html>