<input type="text" name="avalue" size="5" id="a" />
<select name="" id="d"><option >-</option><option >+</option><option >*</option><option >/</option></select>
<input type="text" name="bvalue" size="5" id="b" />=
<input type="button" value="计算" onclick="yunsuan()" />
<input type="text" readonly name="cvalue" size="5" id="c" />
<script language="javascript">
function yunsuan() {
var x, y, z; x=document.getElementById("a").
value; y=document.getElementById("b").
value; s=document.getElementById("d").value z=x+s+y;
if(isNaN(+x)||isNaN(+y)){ alert("shuzi"); return; } var c=eval(z); document.getElementById("c").value=c; }
</script>