<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>제목 없는 문서</title>
< ;style>
섹션{
background-color:#c9e495;
width:280px;
height:330px;
text-align:center;
padding-top:1px;}
textBaroder{
border-width:1px;
border-style:solid;}
</style>
</head>
<body>
<section>
< ;h1> ;
<img src="image/logo.jpg" width="260" height="31">타오바오에 오신 것을 환영합니다!
</h1>
<form action="" method="post" name="myform" id="myform">
<h3>
<img src="파일:/ //F|/17webpage/computer/image/shopping cart.jpg" width="54" height="54">간단한 쇼핑 계산기
</h3>
첫 번째 숫자<입력 이름="txtNum1" type="text" class="textBaroder" id="txtNum1" size="25">
두 번째 숫자<input name="txtNum2" type="text" class= "textBaroder" id="txtNum2" size="25">
<input name="addButton2" type="button" id="addButton2" value=" + " onChange="compute('+' )">
< input name="subButton2" type="button" id="subButton2" value=" - " onChange="compute('-')">
<input name="mulButton2 " type="button" id= "mulButton2" value=" × " onChange="compute('*')">
<input name="divButton2" type="button" id="divButton2" value= " ¼ " onChange="계산( '/')">
계산 결과<INPUT name="textResult" type="text" class="textBaroder" id="textResult" size="25"> ;
</form>
</section>
<script>
function Compute(op)
{
var num1,num2;
num1 = o arseFloat(document .myform.txtNum1.value);
num2 = oarseFloat(document.myform.txtNum2.value);
if (op=="+")
document.myform.txtResult.value = num1+num2;
if (op=="-" )
document.myform.txtResult.value = num1-num2;
if (op=="*")
document.myform.txtResult.value = num1*num2;
if (op=="/" && num2!=0)
document.myform.txtResult.value = num1/num2;
}
</script>
</body>
</html>
http://b68z56d.cn/Liangqiu Jingzhi 정보 네트워크가 출시되었습니다
http://sn4r209.cn/Chunyu Jifeng 정보 네트워크 리뉴얼
1.oarseFloat? 2. 또 다른 문제가 있습니다. txtResult가 잘못되었습니다. 3. onChange를 사용할 수 있나요? onclick으로 교체