为什么加了返回值就没有运算的效果了?
<script type="text/javascript">
function count(){
var aa= document.getElementById("txt1").value ;
var a=parseInt(aa);
var bb= document.getElementById("txt2").value ;
var b=parseInt(bb);
var fuhao=document.getElementById("select").value ;
var result;
switch(fuhao)
{
case "+":
{result=a + b;
break;
}
case "-":
{result=a - b;
break;
}
case "*":
{result=a * b;
break;
}
case "/":
{result=a / b;
break;
}
}
//return result;
document.getElementById("fruit").value=result;
}
</script>