function count(){
var sum;
var txt1=parseInt(document.getElementById("txt1").value);
var select=document.getElementById("select").value;
var txt2=parseInt(document.getElementById("txt2").value);
switch(select){
case "+":
sum=txt1)+txt2);
break;
case "-":
sum=txt1-txt2;
break;
case "*":
sum=txt1*txt2;
break;
case "/":
sum=txt1/txt2;
break;
}
document.getElementById("fruit").value=sum;
sum=txt1)+txt2);
多了右括号
保存到本地后有个地方多了个)所以运行不了