为啥1+1会等于11...??
其他运算没问题 就是加法出问题
其他运算没问题 就是加法出问题
2016-06-28
<script type="text/javascript">
function count(){
var otxt1=document.getElementById("txt1").value;
var otxt2=document.getElementById("txt2").value;
var oselect=document.getElementById("select").value;
var result="";
switch(oselect)
{
case "+":
result=otxt1+otxt2;
break;
case"-":
result=otxt1-otxt2;
break;
case"*":
result=otxt1*otxt2;
break;
default:
result=otxt1/otxt2;
}
document.getElementById("fruit").value=result;
}
</script>举报