为什么case值与select值不匹配,计算也能成功?
<script type="text/javascript">
function count(){
var x=document.getElementById("txt1").value
var y=document.getElementById("txt2").value
var z=document.getElementById("select").value
var s=document.getElementById("fruit").value;
switch(z)
{
case 1;
s=parseInt(x)+parseInt(y);
break;
caee 2;
s=parseInt(x)-parseInt(y);
break;
case 3;
s=parseInt(x)*parseInt(y);
break;
default;
s=parseInt(x)/parseInt(y);
}
}
</script>
</head>
<body>
<input type='text' id='txt1' />
<select id='select'>
<option value='+'>+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
为什么case值与select值不匹配,计算也能成功?