救命怎么用html写一个网页科学计算器

2025-03-28 20:04:33
推荐回答(1个)
回答1:

 
 
 
 
Calculator 
 
 
var numresult; 
var str; 
function onclicknum(nums) { 
str = document.getElementById("nummessege"); 
str.value = str.value + nums; 

function onclickclear() { 
str = document.getElementById("nummessege"); 
str.value = ""; 

function onclickresult() { 
str = document.getElementById("nummessege"); 
numresult = eval(str.value); 
str.value = numresult; 

 
 
 
 
style="height: 350px; width: 270px"> 
 
 
style="height: 90px; width: 350px; font-size: 50px" /> 
 
 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
 
 
style="height: 70px; width: 190px; font-size: 35px"> 
 
 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
onclick="onclicknum('/')" 
style="height: 70px; width: 90px; font-size: 35px"> 
 
 
 
 
onclick="onclickclear()" 
style="height: 70px; width: 190px; font-size: 35px" /> 
 
 
onclick="onclickresult()" 
style="height: 70px; width: 190px; font-size: 35px" />