求大佬看一下 谢谢
没有反应啊
没有反应啊
2021-01-19
function count(){ var sum = ''; //var sum; 改成 var sum = ''; var first= parseInt(document.getElementById("txt1").value); //parseInt() 函数解析字符串,并返回一个整数 var second=parseInt(document.getElementById("txt2").value); var select=document.getElementById("select").value; switch(select) { case '+': sum = first + second; break; case '-': sum = first - second; break; case '*': sum = first * second; break; case '/': sum = first / second; break; } //return sum; document.getElementById("fruit").value = sum; //设置结果输入框的值 }
举报