这样就应该可以解决+的问题了吧
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<input type="text" id="txt1" />
<select id='select'>
<option value='+'>+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<div>
<input type="text" id="txt2" />
<button type="button" onclick="dengyu()">=</button>
</div>
<input type="text" id="txt3">
<script>
function dengyu(){
diyige=document.getElementById("txt1").value;
dierge=document.getElementById("txt2").value;
disange=document.getElementById("select").value;
switch(disange){
case"+":
document.getElementById("txt3").value=parseInt(diyige) + parseInt(dierge);
break;
case"-":
document.getElementById("txt3").value=diyige-dierge;
break;
case"*":
document.getElementById("txt3").value=diyige*dierge;
break;
case"/":
document.getElementById("txt3").value=diyige/dierge;
break;
}
}
</script>
</body>
</html>