<script type="text/javascript">function count() {var a = document.getElementById("txt1").value;var type = document.getElementById("select").value;var b = document.getElementById("txt2").value;switch (type) {case type = "+":document.getElementById("fruit").value = parseInt(a) + parseInt(b);break;case type = "-":document.getElementById("fruit").value = parseInt(a) - parseInt(b);break;case type = "*":document.getElementById("fruit").value = parseInt(a) * parseInt(b);break;case type = "/":document.getElementById("fruit").value = parseInt(a) / parseInt(b);break;default:break;}//获取第一个输入框的值//获取第二个输入框的值//获取选择框的值//获取通过下拉框来选择的值来改变加减乘除的运算法则//设置结果输入框的值 }</script>