为什么我的答案输出不了????
<!DOCTYPE html>
<html>
<head>
<title> 事件</title>
<script type="text/javascript">
function count()
{
var text_1=document.getElementById("txt1").value;
text_1=parseInt(text_1);
var text_2=document.getElementById("txt2").value;
text_2=parseInt(text_2);
//document.write(text_2);
var result;
var p=document.getElementById("select").value;
switch(p)
{
case "+" :
result=text_1+text_2;
break;
case "-" :
result=text_1-text_2;
break;
case "*" :
result=text_1*text_2;
break;
case "/" :
result=text_1/text_2;
break;
default;
}
document.getElementById("fruit").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 name="button" type="button" onClick="vs()" value="=" />
<input type='text' id='fruit' />
</body>
</html>