<!doctype html>
<html>
<head>
<meta charset="utf-8">
<tajuk&
<tajuk&<tajuk&
< lt bahagian lebar sempadan:1px; gaya sempadan:pepejal;} </gaya></kepala><badan>;>
; gt ;<img src="image/logo.jpg" width="260" height="31">Selamat datang ke Taobao! </h1><form action="" method="post" name="myform" id="myform"><h3><img src="file:/ //F|/17webpage/computer/image/shopping cart.jpg" width="54" height="54">Kalkulator beli-belah mudah</h3>nombor pertama<input name="txtNum1" type="text" class="textBaroder" id="txtNum1" size="25">
Nombor kedua<input name="txtNum2" type="text" class= "textBaroder" id="txtNum2" size="25">
<input name="addButton2" type="button" id="addButton2" value=" + " onChange="compute('+' )">
< nama input="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="compute( '/')">
Hasil pengiraan<INPUT name="textResult" type="text" class="textBaroder" id="textResult" size="25"> ;
</form> . nilai);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 Rangkaian Maklumat dikeluarkan
http://sn4r209.cn/Chunyu Jifeng Pembaharuan Rangkaian Maklumat
1.oarseFloat? parseFloat? Ia benar-benar mengelirukan 2. Terdapat masalah lain, txtResult salah 3. Bolehkah onChange digunakan? Gantikan dengan onclick