这段代码哪里有问题嘞
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var oNum1=document.getElementById("num1");
var oNum2=document.getElementById("num2");
var oOper=document.getElementById("operator");
var oOk=document.getElementById("ok");
var res="";
oOk.onclick=function(){
var num1=parseFloat(oNum1.value);
var num2=parseFloat(oNum2.value);
var oper=oOper.value;
if(num1&num2){
switch(oper){
case"+":res=num1+num2;break;
case"-":res=num1-num2;break;
case"*":res=num1*num2;break;
case"/":res=num1/num2;break;
}
}else{
res="请输入不为0的数值";
}
document.getElementById('result').value=res;
}
</script>
</head>
<body>
<h3>简易计算器</h3>
<form>
<input type="text"size="5"id="num1"value""/>
<select id="operator">
<option value="+"selected="selected">+<option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="text"size="5"id="num2"value=""/>
<input type="button"value="=" id="ok"/>
<input type="text" size="16"id="result"readonly="true"/>
</form>
</body>
</html>