事件
function count(){
var a=document.getElementById("txt1").value;
var b=document.getElementById("txt2").value;
var f=document.getElementById("select").value;
switch(f)
{
case '+':document.getElementById("fruit").value=a+b;
break;
case '-':document.getElementById("fruit").value=a-b;
break;
case '*':document.getElementById("fruit").value=a*b;
break;
case '/':document.getElementById("fruit").value=a/b;
break;
}
}
+
-
*
/