求出来的是NaN
window.onload=function()
{
var tt=document.getElementById('txt1').value
var tt2=document.getElementById('txt2').value
var sel=document.getElementById('select').value
var tt3=document.getElementById('txt3')
var dd=document.getElementById('btn1')
var result='';
switch(sel)
{
case "+":
result=parseInt(tt) + parseInt(tt2);
break;
case "-":
result=parseInt(tt) - parseInt(tt2);
break;
case "*":
result=parseInt(tt) * parseInt(tt2);
break;
default:
result=parseInt(tt) / parseInt(tt2);
}
dd.onclick=function()
{
tt3.value=result;
}
}
</script>
</head>
<body>
<input type='text' id='txt1' />
<select id='select'>
<option value='+'>+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type='text' id='txt2' />
<input type='button' value=' = ' id="btn1"/>
<input type='text' id='txt3' >