运行不出来
function count(){
var a=parseInt(document.getElementById('txt1').value);
var b=parseInt(document.getElementById('txt2').value);
var x=document.getElementById('selsect').value;
function count(){
var a=parseInt(document.getElementById('txt1').value);
var b=parseInt(document.getElementById('txt2').value);
var x=document.getElementById('selsect').value;
2016-08-28
function count(){
var mytxt1=document.getElementById("txt1").value;
var mytxt2=document.getElementById("txt2").value;
var mys=document.getElementById("select").value;
var result="";
switch(mys)
{
case "+":
result=parseFloat(mytxt1)+parseFloat(mytxt2);
break;
case "-":
result=parseFloat(mytxt1)-parseFloat(mytxt2);
break;
case "*":
result=parseFloat(mytxt1)*parseFloat(mytxt2);
break;
case "/":
result=parseFloat(mytxt1)/parseFloat(mytxt2);
}
document.getElementById("fruit").value=result;
}
举报