<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function count(){
var a = parseInt(document.getElementById("tex1").value);
var b = parseInt(document.getElementById("tex2").value);
var selectSign = document.getElementById("select").value;

switch (selectSign)
{
case '+': answer = a+b;break;
case '-': answer = a-b;break;
case '*': answer = a*b;break;
case '/': answer = a/b;
}
document.getElementById("fruit").value = answer;
}
</script>
</head>
<body>
<input type="text" />
</body>
</html>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function count(){
var a = parseInt(document.getElementById("tex1").value);
var b = parseInt(document.getElementById("tex2").value);
var selectSign = document.getElementById("select").value;

switch (selectSign)
{
case '+': answer = a+b;break;
case '-': answer = a-b;break;
case '*': answer = a*b;break;
case '/': answer = a/b;
}
document.getElementById("fruit").value = answer;
}
</script>
</head>
<body>
<input type="text" />
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-11-08
  • 2021-11-28
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-21
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案