⑴ 初中學生計算器網頁

http://www.hao123.com/haoserver/jishuqii.htm
這個怎麼樣。望點贊

⑵ 用javaWEB編寫一個簡易的計算器,能直接用記事本改格式運行的網頁版計算器,

用JAVAWEB寫,得用web server!

⑶ 夢幻西遊計算器網頁版

http://xyq.17173.com/jsq/
打開相關網頁,打開夢幻西遊〖 實用工具箱網頁版 〗界面,即可看到如下圖:

直接在專框框里輸入屬數字,比如,想查詢「經驗-->等級」這一項,直接輸入從幾級到幾級後,後面的框內便會顯示數據,以此類推。

人物相關,升級經驗計算、按經驗可或到等級數計算、人物常規計算、點師門技能花費計算、人物修練計算、服務技能計算、打造所需熟練度計算、打造所需體力計算、活力恢復速度計算。跑商輔助:輔助跑商的玩家快速完成交票。轉區查詢(非常精確,調用夢幻西遊官方數據)。養孩子各種計劃書、非常智能的搜索知識教導答案。奇經八脈介紹,在線答題器(裡面涵蓋了科舉考試、圖片題目、周傑倫副本、三屆書院、元宵燈謎、課堂修行等)。

⑷ 如何設計簡單的網頁計算器

⑸ 網頁版計算器代碼

html"><html>
<head>
<title>JS版計算器</title>
<linkrel="stylesheet"type="text/css"href="">
<metahttp-equiv="content-type"content="text/html;charset=utf-8">
<!--js代碼可以放置在任意位置,按照先後順序依次執行一般放在head標簽之間-->
<scripttype="text/javascript">
/*定義一個Calculator類*/
functionCalculator(){
this.jisuan=function(num1,num2,oper){
varres=0;
switch(oper){
case"+":
res=num1+num2;
break;
case"-":
res=num1-num2;
break;
case"*":
res=num1*num2;
break;
case"/":
res=num1/num2;
break;
}
returnres;
}
}
//創建對象
varcalculator=newCalculator();
/*定義全局變數*/
varval=0;//放置輸入的值
varxval=0;//保存轉換Number類型的值
vartemp=0;//保存第一次輸入的值
varoper="";//保存輸入的操作符
/*獲取輸入數字*/
functioninputEvent(e){
val=e.value
varxsval=document.getElementById("inp1");
xsval.value+=val;//連續輸入數字(String類型)
//轉換Number類型
xval=parseFloat(xsval.value);
}
/*獲取第一行的數據*/
functioninputPCB(e){
//window.alert(e.value);
varxsval=document.getElementById("inp1");
if(e.value=="Clear"){
xsval.value="";
}elseif(e.value=="Back"){
/*這個功能還沒有實現,有興趣的朋友可以自己做一做*/
}elseif(e.value=="POWER"){
//計算平方
xsval.value=Math.pow(xsval.value,2);
}
}
/*輸入操作符*/
functioninputOper(e){
oper=e.value;
//window.alert(typeofoper);
//oper=oper.substr(0);
if(e.value=="+"){
varxsval=document.getElementById("inp1");
//保存上次計算結果,並對字元串進行轉換Number類型
temp=parseFloat(xsval.value);
//第一次輸入的值設置為空
xsval.value="";
}elseif(e.value=="-"){
varxsval=document.getElementById("inp1");
temp=parseFloat(xsval.value);
xsval.value="";
}elseif(e.value=="*"){
varxsval=document.getElementById("inp1");
temp=parseFloat(xsval.value);
xsval.value="";
}elseif(e.value=="/"){
varxsval=document.getElementById("inp1");
temp=parseFloat(xsval.value);
xsval.value="";
}
}
/*計算結果*/
functioninputEquel(e){
varxsval=document.getElementById("inp1");
if(e.value=="="){
//window.alert(xval);
//調用對象方法
xsval.value=calculator.jisuan(temp,xval,oper);
}
}
</script>
<!--css樣式-->
<style>
input{
width:60px;
}
#inp1{
width:280px;
text-align:right;
}
</style>
</head>
<body>
<tableborder="1">
<!--顯示結果行-->
<tr><tdcolspan="4"><inputid="inp1"type="text"value=""name="xianshi"/></td></tr>
<!--第一行-->
<tr><td><inputtype="button"value="POWER"onclick="inputPCB(this)"/></td><td><inputtype="button"value="Clear"onclick="inputPCB(this)"/></td><td><inputtype="button"value="Back"onclick="inputPCB(this)"/></td><td></td></tr>
<!--第二行-->
<tr><td><inputtype="button"value="1"onclick="inputEvent(this)"/></td><td><inputtype="button"value="2"onclick="inputEvent(this)"/></td><td><inputtype="button"value="3"onclick="inputEvent(this)"/></td><td><inputtype="button"value="4"onclick="inputEvent(this)"/></td></tr>
<!--第三行-->
<tr><td><inputtype="button"value="5"onclick="inputEvent(this)"/></td><td><inputtype="button"value="6"onclick="inputEvent(this)"/></td><td><inputtype="button"value="7"onclick="inputEvent(this)"/></td><td><inputtype="button"value="8"onclick="inputEvent(this)"/></td></tr>
<!--第四行-->
<tr><td><inputtype="button"value="9"onclick="inputEvent(this)"/></td><td><inputtype="button"value="0"onclick="inputEvent(this)"/></td><td><inputtype="button"value="."onclick="inputEvent(this)"/></td><td><inputtype="button"value="="onclick="inputEquel(this)"/></td></tr>
<!--第五行-->
<tr><td><inputtype="button"value="+"onclick="inputOper(this)"/></td><td><inputtype="button"value="-"onclick="inputOper(this)"/></td><td><inputtype="button"value="*"onclick="inputOper(this)"/></td><td><inputtype="button"value="/"onclick="inputOper(this)"/></td></tr>
</table>
</body>
</html>

⑹ 網頁上的功率計算器准確嗎

以你這套配置的功耗大約 65+20+5+10+65+15+15(其他)=180W,這些都是滿載功耗。
選擇電源一般在滿載上冗餘30%比較適合。那就是180+180*0.3=240W。因此選擇250W即可。
考慮到CPU 顯卡都是由+12V輸出,那至少需要12A,因此不能選擇虛標產品。

⑺ 用JavaScript做個網頁版的計算器

哎呀!這個簡單!!我給你啦!!!下面就是用Jscript寫的計算器了復制後保存一切就OK的啦!!!!!!!!!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--written by GoldHuman li hai-->
<!--2000.8-->
<title>科學計算器</title>
<style>
<!--
BODY {
font-family: "宋體", "Arial", "Times New Roman";
font-size: 9pt;
background-color: #edf0e1;
color: #0001fC;
background-attachment: fixed;
}
td{font-family: "宋體", "Arial Narrow", "Times New Roman"; font-size:9pt; font-color:#000000}
//-->
</style>
<script language="javascript">
<!--
var endNumber=true
var mem=0
var carry=10
var hexnum="0123456789abcdef"
var angle="d"
var stack=""
var level="0"
var layer=0

//數字鍵

function inputkey(key)
{
var index=key.charCodeAt(0);
if ((carry==2 && (index==48 || index==49))
|| (carry==8 && index>=48 && index<=55)
|| (carry==10 && (index>=48 && index<=57 || index==46))
|| (carry==16 && ((index>=48 && index<=57) || (index>=97 && index<=102))))
if(endNumber)
{
endNumber=false
document.calc.display.value = key
}
else if(document.calc.display.value == null || document.calc.display.value == "0")
document.calc.display.value = key
else
document.calc.display.value += key
}

function changeSign()
{
if (document.calc.display.value!="0")
if(document.calc.display.value.substr(0,1) == "-")
document.calc.display.value = document.calc.display.value.substr(1)
else
document.calc.display.value = "-" + document.calc.display.value
}

//函數鍵

function inputfunction(fun,shiftfun)
{
endNumber=true
if (document.calc.shiftf.checked)
document.calc.display.value=decto(funcalc(shiftfun,(todec(document.calc.display.value,carry))),carry)
else
document.calc.display.value=decto(funcalc(fun,(todec(document.calc.display.value,carry))),carry)
document.calc.shiftf.checked=false
document.calc.hypf.checked=false
inputshift()
}

function inputtrig(trig,arctrig,hyp,archyp)
{
if (document.calc.hypf.checked)
inputfunction(hyp,archyp)
else
inputfunction(trig,arctrig)
}

//運算符

function operation(join,newlevel)
{
endNumber=true
var temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.value
while (newlevel!=0 && (newlevel<=(level.charAt(level.length-1))))
{
temp=parse(temp)
level=level.slice(0,-1)
}
if (temp.match(/^(.*\d[\+\-\*\/\%\^\&\|x])?([+-]?[0-9a-f\.]+)$/))
document.calc.display.value=RegExp.$2
stack=stack.substr(0,stack.lastIndexOf("(")+1)+temp+join
document.calc.operator.value=" "+join+" "
level=level+newlevel

}

//括弧

function addbracket()
{
endNumber=true
document.calc.display.value=0
stack=stack+"("
document.calc.operator.value=" "
level=level+0

layer+=1
document.calc.bracket.value="(="+layer
}

function disbracket()
{
endNumber=true
var temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.value
while ((level.charAt(level.length-1))>0)
{
temp=parse(temp)
level=level.slice(0,-1)
}

document.calc.display.value=temp
stack=stack.substr(0,stack.lastIndexOf("("))
document.calc.operator.value=" "
level=level.slice(0,-1)

layer-=1
if (layer>0)
document.calc.bracket.value="(="+layer
else
document.calc.bracket.value=""
}

//等號

function result()
{
endNumber=true
while (layer>0)
disbracket()
var temp=stack+document.calc.display.value
while ((level.charAt(level.length-1))>0)
{
temp=parse(temp)
level=level.slice(0,-1)
}

document.calc.display.value=temp
document.calc.bracket.value=""
document.calc.operator.value=""
stack=""
level="0"
}

//修改鍵

function backspace()
{
if (!endNumber)
{
if(document.calc.display.value.length>1)
document.calc.display.value=document.calc.display.value.substring(0,document.calc.display.value.length - 1)
else
document.calc.display.value=0
}
}

function clearall()
{
document.calc.display.value=0
endNumber=true
stack=""
level="0"
layer=""
document.calc.operator.value=""
document.calc.bracket.value=""
}

//轉換鍵

function inputChangCarry(newcarry)
{
endNumber=true
document.calc.display.value=(decto(todec(document.calc.display.value,carry),newcarry))
carry=newcarry

document.calc.sin.disabled=(carry!=10)
document.calc.cos.disabled=(carry!=10)
document.calc.tan.disabled=(carry!=10)
document.calc.bt.disabled=(carry!=10)
document.calc.pi.disabled=(carry!=10)
document.calc.e.disabled=(carry!=10)
document.calc.kp.disabled=(carry!=10)

document.calc.k2.disabled=(carry<=2)
document.calc.k3.disabled=(carry<=2)
document.calc.k4.disabled=(carry<=2)
document.calc.k5.disabled=(carry<=2)
document.calc.k6.disabled=(carry<=2)
document.calc.k7.disabled=(carry<=2)
document.calc.k8.disabled=(carry<=8)
document.calc.k9.disabled=(carry<=8)
document.calc.ka.disabled=(carry<=10)
document.calc.kb.disabled=(carry<=10)
document.calc.kc.disabled=(carry<=10)
document.calc.kd.disabled=(carry<=10)
document.calc.ke.disabled=(carry<=10)
document.calc.kf.disabled=(carry<=10)

}

function inputChangAngle(angletype)
{
endNumber=true
angle=angletype
if (angle=="d")
document.calc.display.value=radiansToDegress(document.calc.display.value)
else
document.calc.display.value=degressToRadians(document.calc.display.value)
endNumber=true
}

function inputshift()
{
if (document.calc.shiftf.checked)
{
document.calc.bt.value="deg "
document.calc.ln.value="exp "
document.calc.log.value="expd"

if (document.calc.hypf.checked)
{
document.calc.sin.value="ahs "
document.calc.cos.value="ahc "
document.calc.tan.value="aht "
}
else
{
document.calc.sin.value="asin"
document.calc.cos.value="acos"
document.calc.tan.value="atan"
}

document.calc.sqr.value="x^.5"
document.calc.cube.value="x^.3"

document.calc.floor.value="小數"
}
else
{
document.calc.bt.value="d.ms"
document.calc.ln.value=" ln "
document.calc.log.value="log "

if (document.calc.hypf.checked)
{
document.calc.sin.value="hsin"
document.calc.cos.value="hcos"
document.calc.tan.value="htan"
}
else
{
document.calc.sin.value="sin "
document.calc.cos.value="cos "
document.calc.tan.value="tan "
}

document.calc.sqr.value="x^2 "
document.calc.cube.value="x^3 "

document.calc.floor.value="取整"
}

}
//存儲器部分

function clearmemory()
{
mem=0
document.calc.memory.value=" "
}

function getmemory()
{
endNumber=true
document.calc.display.value=decto(mem,carry)
}

function putmemory()
{
endNumber=true
if (document.calc.display.value!=0)
{
mem=todec(document.calc.display.value,carry)
document.calc.memory.value=" M "
}
else
document.calc.memory.value=" "
}

function addmemory()
{
endNumber=true
mem=parseFloat(mem)+parseFloat(todec(document.calc.display.value,carry))
if (mem==0)
document.calc.memory.value=" "
else
document.calc.memory.value=" M "
}

function multimemory()
{
endNumber=true
mem=parseFloat(mem)*parseFloat(todec(document.calc.display.value,carry))
if (mem==0)
document.calc.memory.value=" "
else
document.calc.memory.value=" M "
}

//十進制轉換

function todec(num,oldcarry)
{
if (oldcarry==10 || num==0) return(num)
var neg=(num.charAt(0)=="-")
if (neg) num=num.substr(1)
var newnum=0
for (var index=1;index<=num.length;index++)
newnum=newnum*oldcarry+hexnum.indexOf(num.charAt(index-1))
if (neg)
newnum=-newnum
return(newnum)
}

function decto(num,newcarry)
{
var neg=(num<0)
if (newcarry==10 || num==0) return(num)
num=""+Math.abs(num)
var newnum=""
while (num!=0)
{
newnum=hexnum.charAt(num%newcarry)+newnum
num=Math.floor(num/newcarry)
}
if (neg)
newnum="-"+newnum
return(newnum)
}

//表達式解析

function parse(string)
{
if (string.match(/^(.*\d[\+\-\*\/\%\^\&\|x\<])?([+-]?[0-9a-f\.]+)([\+\-\*\/\%\^\&\|x\<])([+-]?[0-9a-f\.]+)$/))
return(RegExp.$1+cypher(RegExp.$2,RegExp.$3,RegExp.$4))
else
return(string)
}

//數學運算和位運算

function cypher(left,join,right)
{
left=todec(left,carry)
right=todec(right,carry)
if (join=="+")
return(decto(parseFloat(left)+parseFloat(right),carry))
if (join=="-")
return(decto(left-right,carry))
if (join=="*")
return(decto(left*right,carry))
if (join=="/" && right!=0)
return(decto(left/right,carry))
if (join=="%")
return(decto(left%right,carry))
if (join=="&")
return(decto(left&right,carry))
if (join=="|")
return(decto(left|right,carry))
if (join=="^")
return(decto(Math.pow(left,right),carry))
if (join=="x")
return(decto(left^right,carry))
if (join=="<")
return(decto(left<<right,carry))
alert("除數不能為零")
return(left)
}

//函數計算

function funcalc(fun,num)
{
with(Math)
{
if (fun=="pi")
return(PI)
if (fun=="e")
return(E)

if (fun=="abs")
return(abs(num))
if (fun=="ceil")
return(ceil(num))
if (fun=="round")
return(round(num))

if (fun=="floor")
return(floor(num))
if (fun=="deci")
return(num-floor(num))

if (fun=="ln" && num>0)
return(log(num))
if (fun=="exp")
return(exp(num))
if (fun=="log" && num>0)
return(log(num)*LOG10E)
if (fun=="expdec")
return(pow(10,num))

if (fun=="cube")
return(num*num*num)
if (fun=="cubt")
return(pow(num,1/3))
if (fun=="sqr")
return(num*num)
if (fun=="sqrt" && num>=0)
return(sqrt(num))

if (fun=="!")
return(factorial(num))

if (fun=="recip" && num!=0)
return(1/num)

if (fun=="dms")
return(dms(num))
if (fun=="deg")
return(deg(num))

if (fun=="~")
return(~num)

if (angle=="d")
{
if (fun=="sin")
return(sin(degressToRadians(num)))
if (fun=="cos")
return(cos(degressToRadians(num)))
if (fun=="tan")
return(tan(degressToRadians(num)))

if (fun=="arcsin" && abs(num)<=1)
return(radiansToDegress(asin(num)))
if (fun=="arccos" && abs(num)<=1)
return(radiansToDegress(acos(num)))
if (fun=="arctan")
return(radiansToDegress(atan(num)))
}
else
{
if (fun=="sin")
return(sin(num))
if (fun=="cos")
return(cos(num))
if (fun=="tan")
return(tan(num))

if (fun=="arcsin" && abs(num)<=1)
return(asin(num))
if (fun=="arccos" && abs(num)<=1)
return(acos(num))
if (fun=="arctan")
return(atan(num))
}

if (fun=="hypsin")
return((exp(num)-exp(0-num))*0.5)
if (fun=="hypcos")
return((exp(num)+exp(-num))*0.5)
if (fun=="hyptan")
return((exp(num)-exp(-num))/(exp(num)+exp(-num)))

if (fun=="ahypsin" | fun=="hypcos" | fun=="hyptan")
{
alert("對不起,公式還沒有查到!")
return(num)
}

alert("超出函數定義范圍")
return(num)
}
}

function factorial(n)
{
n=Math.abs(parseInt(n))
var fac=1
for (;n>0;n-=1)
fac*=n
return(fac)
}

function dms(n)
{
var neg=(n<0)
with(Math)
{
n=abs(n)
var d=floor(n)
var m=floor(60*(n-d))
var s=(n-d)*60-m
}
var dms=d+m/100+s*0.006
if (neg)
dms=-dms
return(dms)
}

function deg(n)
{
var neg=(n<0)
with(Math)
{
n=abs(n)
var d=floor(n)
var m=floor((n-d)*100)
var s=(n-d)*100-m
}
var deg=d+m/60+s/36
if (neg)
deg=-deg
return(deg)
}

function degressToRadians(degress)
{
return(degress*Math.PI/180)
}

function radiansToDegress(radians)
{
return(radians*180/Math.PI)
}

//界面

//-->
</script>
</head>
<!--written by GoldHuman li hai-->
<!--2000.8-->
<body>
<div align="center">
<form name=calc>
<table border="1" width="500" height="250">
<tr>
<td height=50>
<table width=500>
<td>
<img src="../img/cp_logo.gif">
</td>
<td>
<div align=center>
<input type=text name="display" value="0" readonly size="40">
</div>
</td>
</table>
</td>
</tr>
<tr>
<td>
<table width=500>
<tr>
<td width=290>
<input type=radio name="carry" onClick="inputChangCarry(16)">
十六進制
<input type=radio name="carry" checked onClick="inputChangCarry(10)">
十進制
<input type=radio name="carry" onClick="inputChangCarry(8)">
八進制
<input type=radio name="carry" onClick="inputChangCarry(2)">
二進制
</td>
<td>
</td>
<td width=135>
<input type=radio name="angle" value="d" onClick="inputChangAngle('d')" checked>
角度制
<input type=radio name="angle" value="r" onClick="inputChangAngle('r')">
弧度制
</td>
</tr>
</table>
<table width=500>
<tr>
<td width=170>
<input name="shiftf" type="checkbox" onclick="inputshift()">上檔功能
<input name="hypf" type="checkbox" onclick="inputshift()">雙曲函數
</td>
<td>
<input name="bracket" value="" type=text size=3 readonly style="background-color=lightgrey">
<input name="memory" value="" type=text size=3 readonly style="background-color=lightgrey">
<input name="operator" value="" type=text size=3 readonly style="background-color=lightgrey">
</td>
<td width=183>
<input type="button" value=" 退格 "
onclick="backspace()" style="color=red">
<input type="button" value=" 清屏 "
onClick="document.calc.display.value = 0 " style="color=red">
<input type="button" value=" 全清"
onClick="clearall()" style="color=red">
</td>
</tr>
</table>

<table width=500>
<tr>
<td>
<table>
<tr align=center>
<td>
<input name=pi type="button" value=" PI "
onClick="inputfunction('pi','pi')" style="color=blue">
</td>

<td>
<input name=e type="button" value=" E "
onClick="inputfunction('e','e')" style="color=blue">
</td>

<td>
<input name=bt type="button" value="d.ms"
onClick="inputfunction('dms','deg')" style="color=#ff00ff">
</td>
</tr>
<tr align=center>
<td>
<input type="button" value=" ( "
onClick="addbracket()" style="color=#ff00ff">
</td>

<td>
<input type="button" value=" ) "
onClick="disbracket()" style="color=#ff00ff">
</td>

<td>
<input name=ln type="button" value=" ln "
onClick="inputfunction('ln','exp')" style="color=#ff00ff">
</td>
</tr>
<tr align=center>
<td>
<input name=sin type="button" value="sin "
onClick="inputtrig('sin','arcsin','hypsin','ahypsin')" style="color=#ff00ff">
</td>

<td>
<input type="button" value="x^y "
onClick="operation('^',7)" style="color=#ff00ff">
</td>

<td>
<input name=log type="button" value="log "
onClick="inputfunction('log','expdec')" style="color=#ff00ff">
</td>
</tr>
<tr align=center>
<td>
<input name=cos type="button" value="cos "
onClick="inputtrig('cos','arccos','hypcos','ahypcos')" style="color=#ff00ff">
</td>

<td>
<input name=cube type="button" value="x^3 "
onClick="inputfunction('cube','cubt')" style="color=#ff00ff">
</td>

<td>
<input type="button" value=" n! "
onClick="inputfunction('!','!')" style="color=#ff00ff">
</td>
</tr>
<tr align=center>
<td>
<input name=tan type="button" value="tan "
onClick="inputtrig('tan','arctan','hyptan','ahyptan')" style="color=#ff00ff">
</td>

<td>
<input name=sqr type="button" value="x^2 "
onClick="inputfunction('sqr','sqrt')" style="color=#ff00ff">
</td>

<td>
<input type="button" value="1/x "
onClick="inputfunction('recip','recip')" style="color=#ff00ff">
</td>
</tr>
</table>
</td>
<td width=30>
</td>
<td>
<table>
<tr>
<td>
<input type="button" value=" 儲存 "
onClick="putmemory()" style="color=red">
</td>
</tr>
<td>
<input type="button" value=" 取存 "
onClick="getmemory()" style="color=red">
</td>
</tr>
<tr>
<td>
<input type="button" value=" 累存 "
onClick="addmemory()" style="color=red">
</td>
</tr>
<tr>
<td>
<input type="button" value=" 積存 "
onClick="multimemory()" style="color=red">
</td>
</tr>
<tr>
<td height="33">
<input type="button" value=" 清存 "
onClick="clearmemory()" style="color=red">
</td>
</tr>
</table>
</td>
<td width=30>
</td>
<td>
<table>
<tr align=center>
<td>
<input name=k7 type="button" value=" 7 "
onClick="inputkey('7')" style="color=blue">
</td>

<td>
<input name=k8 type="button" value=" 8 "
onClick="inputkey('8')" style="color=blue">
</td>

<td>
<input name=k9 type="button" value=" 9 "
onClick="inputkey('9')" style="color=blue">
</td>

<td>
<input type="button" value=" / "
onClick="operation('/',6)" style="color=red">
</td>

<td>
<input type="button" value="取余"
onClick="operation('%',6)" style="color=red">
</td>

<td>
<input type="button" value=" 與 "
onClick="operation('&',3)" style="color=red">
</td>
</tr>

<tr align=center>
<td>
<input name=k4 type="button" value=" 4 "
onClick="inputkey('4')" style="color=blue">
</td>

<td>
<input name=k5 type="button" value=" 5 "
onClick="inputkey('5')" style="color=blue">
</td>

<td>
<input name=k6 type="button" value=" 6 "
onClick="inputkey('6')" style="color=blue">
</td>

<td>
<input type="button" value=" * "
onClick="operation('*',6)" style="color=red">
</td>

<td>
<input name=floor type="button" value="取整"
onClick="inputfunction('floor','deci')" style="color=red">
</td>

<td>
<input type="button" value=" 或 "
onClick="operation('|',1)" style="color=red">
</td>
</tr>

<tr align=center>
<td>
<input type="button" value=" 1 "
onClick="inputkey('1')" style="color=blue">
</td>

<td>
<input name=k2 type="button" value=" 2 "
onClick="inputkey('2')" style="color=blue">
</td>

<td>
<input name=k3 type="button" value=" 3 "
onClick="inputkey('3')" style="color=blue">
</td>

<td>
<input type="button" value=" - "
onClick="operation('-',5)" style="color=red">
</td>

<td>
<input type="button" value="左移"
onClick="operation('<',4)" style="color=red">
</td>

<td>
<input type="button" value=" 非 "
onClick="inputfunction('~','~')" style="color=red">
</td>
</tr>

<tr align=center>
<td>
<input type="button" value=" 0 "
onClick="inputkey('0')" style="color=blue">
</td>

<td>
<input type="button" value="+/-"
onClick="changeSign()" style="color=blue">
</td>

<td>
<input name=kp type="button" value=" . "
onClick="inputkey('.')" style="color=blue">
</td>

<td>
<input type="button" value=" + "
onClick="operation('+',5)" style="color=red">
</td>

<td>
<input type="button" value=" = "
onClick="result()" style="color=red">
</td>

<td>
<input type="button" value="異或"
onClick="operation('x',2)" style="color=red">
</td>
</tr>

<tr align=center>
<td>
<input name=ka type="button" value=" A "
onClick="inputkey('a')" style="color=blue" disabled=true>
</td>

<td>
<input name=kb type="button" value=" B "
onClick="inputkey('b')" style="color=blue" disabled=true>
</td>

<td>
<input name=kc type="button" value=" C "
onClick="inputkey('c')" style="color=blue" disabled=true>
</td>

<td>
<input name=kd type="button" value=" D "
onClick="inputkey('d')" style="color=blue" disabled=true>
</td>

<td>
<input name=ke type="button" value=" E"
onClick="inputkey('e')" style="color=blue" disabled=true>
</td>

<td>
<input name=kf type="button" value=" F"
onClick="inputkey('f')" style="color=blue" disabled=true>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

⑻ 網頁版計算器

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WEB計算器</title>
<!---計算器功能模塊-->
<script language="javascript" type="text/javascript" runat="server">

var lingState="beStart"; //當前狀態
var curOper="start"; //當前運算符
var num1=0; //初值
var num2=0; //初值

var subOper=false; // 是否剛剛單擊過運算符
var upOper=false;//運算符的標簽
var tnumber=false;//MR記住顯示框的狀態
var cM=false;//記住M啟動
var xM=false;//記住按M+
var ms=false;//記住是否按MS
var sk=false;

var twonumber=false;
var ss;//保存MS要保存的值
var sb=0;
//數字鍵觸發功能模塊
function number(i)
{

if(subOper ) //表示在此之前剛剛單擊過運算符或者剛剛單擊過等號
{
form.ipt.value=i; //把輸入的值賦給文本框顯示
subOper=false;//輸入數後,點擊了符號
lingState="beInteger";
}
else
{ //表示正在進行或開始一個數字的輸入

if(form.ipt.value=="0")//當文本顯示框為0時,則把剛剛單擊的數值賦給文本框
{
form.ipt.value=i;//當符合條件則把單擊的數值(this.value)賦予給顯示框1
lingState="beInteger";
}
else
form.ipt.value += i;//當文本顯示框不為0,則數值累加顯示文本框
}
if(curOper!="start")//判斷是否單擊過運算符
{
num2=form.ipt.value;
}
// alert("初值num1的值"+num1);
// alert("num2的值"+num2);
//lingState="beStart"; //清除當前狀態
upOper=true;//記住輸入數字 以便下面+號連+運算
tnumber=true;//記住有值
}

/* + - * / */

//結果運算模塊
function sum()
{

if (curOper!="start")//判斷是否單擊按鈕(符號為空
{
switch(curOper)
{
case "+": //判斷符號為+時執行+運算
num1= parseFloat(num1)+parseFloat(num2); //把第一次輸入的值和第二次的值進行運算
break;
case "-": //判斷符號為-時執行+運算
num1= parseFloat(num1)-parseFloat(num2);
break;
case "*": //判斷符號為*時執行+運算
num1= parseFloat(num1)*parseFloat(num2);
break;
case "/": //判斷符號為/時執行+運算
if(num2=="0")
{
alert("除數不能為零");
}
else{
num1= parseFloat(num1)/parseFloat(num2);
}
break;
}
form.ipt.value=num1;//把運算結果賦給顯示框
}
subOper=true;//輸入數後,點擊了符號
//curOper="start"; //清除當前符號狀態
lingState="beStart";//清除當前狀態
upOper=false;//=運算一次後記住 避免再按+號又進行運算 ( 清除當前符號狀態
sk=true;

}
//常規符號運算功能模塊
function allfhao(i)
{
subOper=true;//輸入數後 輸入符號 進行運算
if (curOper=="start")//實現連運算 原理:當運行當前運算符時實現連運算
{
num1=form.ipt.value; //把第一個數賦值給num1
curOper=i; //單擊運算符用變數把運算符記住
tnumber=true;
}
else
{
if(upOper)//當upOper為真時則實現連運算
{
sum();//當符合條件時調用結果運算 實現連運算
}
curOper=i;//單擊運算符用變數把運算符記住
}
upOper=false;//=運算一次後記住 避免再按+號又進行運算 ( 清除當前符號狀態
lingState="beStart";//清除當前狀態
// alert("符號num1的值"+num1);
// alert("num2的值"+num2);

}

//小數點功能模塊
function point()
{
if(form.ipt.value.indexOf(".")==-1) //判斷是否有小數點,如果有就不顯示 如果沒有那麼進行下面的運算
{
if(lingState=="beStart")//如果進行了等號運算 但並沒有小數點 但單擊了小數點則顯示0.幾
{
form.ipt.value="0.";//當符合條件則顯示框1 顯示0.
subOper=false;//輸入數後,點擊了符號
lingState="beFloat"; //讓一個變數記住以輸入小數點
}
if(lingState=="beInteger" )//判斷是否有數輸入,如果有數數輸入但不是接這等號運算則顯示小數點
{
form.ipt.value+=".";//當符合條件則顯示小數點
lingState="beFloat";//用一個變數記住已經輸入一個小數點,當下次輸入由於值的改變則不能輸入,起到只能輸入一個小數點的功能
}
}
}

//全部清除功能模塊 C CE Backspace
function cleaktext(i)
{
switch(i)
{
case"C"://清除C
form.ipt.value="0"; //清除文本框內的內容
lingState="beStart"; //清除當前狀態
curOper="start"; //清除當前符號狀態
subOper=false; // 是否剛剛單擊過運算符
upOper=false;//運算符的標簽
num1=0;
num2=0;
break;
case"CE": //清除CE
form.ipt.value="0"; //清除文本框內的內容
break;
case"Backspace": //推格刪除
if(cM=false)//如果啟動MR那麼不能實現推格功能
{
if(upOper)
{
if (form.ipt.value.length>1)
{
form.ipt.value=form.ipt.value.substring(0,form.ipt.value.length-1); //運用substring取字元串方法將返回一個包含從原始對象中獲得的子字元串的 String 對象。 使用 start 和 end 兩者的較小值作為子字元串的起始點。
}
else
{
form.ipt.value="0";//一個一個刪除
}
}
break;

}
}
}
/* % 1/x sqrt +/- pi */

//全部的特殊符號運算模塊
function alltx(i)
{

switch(i)
{
case "%"://%運算
form.ipt.value=form.ipt.value/100;
num2=form.ipt.value;
break;

case "1/x":
if(form.ipt.value=="0"){

form.ipt.value="除數不能為零。";
}
else {
form.ipt.value=1/form.ipt.value;
num2=form.ipt.value;
}
break;
case "sqrt"://開方
form.ipt.value=Math.sqrt(form.ipt.value); //math對象 開方運算
num2=form.ipt.value;
break;
case "+/-"://+/-運算符 負號運算
if(upOper)//當運行了符號則不能按負號
{
form.ipt.value=0-form.ipt.value;
num2=form.ipt.value;
}
else{
form.ipt.value="0";
}
break;
case "pi":
form.ipt.value="3.1415926";
num2=form.ipt.value;
break;
case "sin":
form.ipt.value=Math.sin(form.ipt.value);
num2=form.ipt.value;
break;
case "cos":
form.ipt.value=Math.sin(form.ipt.value);
num2=form.ipt.value;
break;
case "tan":
form.ipt.value=Math.sin(form.ipt.value);
num2=form.ipt.value;
break;
}

}
//全部M系列功能模塊
function checkallM(i){

switch(i)
{
case"M+"://啟動M系列功能模塊
if(form.ipt.value!="0" && ms==false)
{
form.ipt1.value="M";//在顯示框2顯示M以告知用戶以啟動M系列功能
sm=form.ipt.value;
}

if(form.ipt1.value=="M" && ms!=false)
{
sm=eval(ss+'+'+form.ipt.value);//MR保存的值提取實現M+功能
}
xM=true; //記住單擊過M+ 以便MR操作
break;
case "MS"://啟用M系列功能 啟動記憶功能(記憶上一次計算結果)
ss=form.ipt.value;// 把顯示框結果給SS保存(予以MR提取
if(form.ipt.value=="0")//當顯示框1顯示結果為0時單擊MS時也可以清除顯示框2 M功能
{
form.ipt1.value="";//清除顯示框2 M
}
if(form.ipt.value!="0")
{
form.ipt1.value="M";
}
ms=true; //記住單擊過Ms 以便MR操作 (看是否賦+運算後的值 還是當前值
break;
case "MR"://提取MS保存數值功能
if(xM)//是否單擊m+
{
if(form.ipt1.value=="M" )//當啟動M功能時 MR才能起到保存提取的功能
{
form.ipt.value=sm;//當條件符合 則把MS保存的值 並實現M+功能
}
else if(subOper || tnumber){//沒有啟動M功能 則清除顯示框
form.ipt.value="0";
}
}
// else{ form.ipt.value=ss;}
break;
case "MC": // 清除M顯示框中M系列的功能
form.ipt1.value="";//清空顯示框2的 M功能
xM=false;
ms=false;
break;
}
cM=true;
lingState="beStart";//清除當前狀態
}

//onLoad="setStart()"
</script>
<style type="text/css" >

#c{
width:320px;
height:270px;
border:#666666 5px groove;

background-color:#ECE9D8

}
#ipts{ margin:5px 5px 3px 5px; text-align:right; width:270px}
#s{ margin:7px 5px 6px 5px; height:200px}
.bt{ width:30px; height:30px; background-color:#ECE9D8; border:solid 1px #C8C6B0}
.bt2{width:75px; height:30px; color:#F00; background-color:#ECE9D8; border:solid 1px #C8C6B0;}
.bt3{width:20px; height:20px; text-align:center;}
.wz{ font-size:12px}

</style>
</head>
<body >

<!---隱藏層-->
<div id="s">
<FORM METHOD=POST ACTION="" name="form">
<div id="c">
<table width="98%" height="268" border="0" align="center" cellpadding="0">
<tr>
<td height="19" colspan="7">
<table width="294" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td class="wz" width="12" height="19"></td>
<td class="wz" width="47">編輯(E)</td>
<td class="wz" width="49">查看(V)</td>
<td class="wz" width="186">幫助(H)</td>
</tr>
</table></td></tr>
<tr>
<td height="29" colspan="7">
<div id="ipts">
<input name="ipt" type="text" id="ipts" value="0" size="40" maxlength="20" readonly="readonly" />
</div>
</td></tr>
<!-- ipt1 Backspace CE C -->
<tr>
<td height="38" colspan="7" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="center"><input name="ipt1" type="text" disabled="disabled" class="bt3" size="1" maxlength="0" /></td>
<td width="86%" align="center"><table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><input name="button23" type="button" class="bt2" id="button23" style="color:#00F" value="Backspace" onclick="cleaktext(this.value)"/></td>
<td align="center"><input style="color:#00F" name="button21" type="button" class="bt2" id="button20" value="CE" onclick="cleaktext(this.value)"/></td>
<td align="center"><input style="color:#00F" name="button20" type="button" class="bt2" id="button21" value="C" onclick="cleaktext(this.value)"/></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!-- MC 7 8 9 / sqrt -->
<tr>
<td width="16%" align="center"><table width="99%" height="162" border="0">
<tr>
<td height="35" align="center"><input style="color:#F00" type="button" value="MC" class="bt" onclick="checkallM(this.value)"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button1" type="button" class="bt" id="button1" value="7" onclick="number(this.value)" /></td>
<td width="14%" align="center"><input style="color:#00F" name="button2" type="button" class="bt" id="button2" value="8" onclick="number(this.value)" /></td>
<td width="14%" align="center"><input style="color:#00F" name="button3" type="button" class="bt" id="button3" value="9" onclick="number(this.value)"/></td>
<td width="13%" align="center"><input style="color:#F00" name="button4" type="button" class="bt" id="button4" value="/" onclick="allfhao(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button5" type="button" class="bt" id="button5" value="sqrt" onclick="alltx(this.value)"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button24" type="button" class="bt" id="button24" value="sin" onclick="alltx(this.value)"/></td>
</tr>

<!-- MR 4 5 6 * % -->

<tr>
<td width="13%" height="39" align="center"><input style="color:#F00" type="button" value="MR" class="bt" onclick="checkallM(this.value)"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button6" type="button" class="bt" id="button6" value="4" onclick="number(this.value)" /></td>
<td width="14%" align="center"><input style="color:#00F" name="button7" type="button" class="bt" id="button7" value="5" onclick="number(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button8" type="button" class="bt" id="button8" value="6" onclick="number(this.value)"/></td>
<td width="13%" align="center"><input style="color:#F00" name="button9" type="button" class="bt" id="button9" value="*" onclick="allfhao(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button10" type="button" class="bt" id="button10" value="%" onclick="alltx(this.value)"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button25" type="button" class="bt" id="button25" value="cos" onclick="alltx(this.value)"/></td>
</tr>

<!-- MS 1 2 3 - 1/x -->
<tr>
<td width="13%" height="38" align="center"><input style="color:#F00" type="button" value="MS" class="bt" onclick="checkallM(this.value)" /></td>
<td width="16%" align="center"><input style="color:#00F" name="button11" type="button" class="bt" id="button11" value="1" onclick="number(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button12" type="button" class="bt" id="button12" value="2" onclick="number(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button13" type="button" class="bt" id="button13" value="3" onclick="number(this.value)"/></td>
<td width="13%" align="center"><input style="color:#F00" name="button14" type="button" class="bt" id="button14" value="-" onclick="allfhao(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button15" type="button" class="bt" id="button15" value="1/x" onclick="alltx(this.value)"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button26" type="button" class="bt" id="button26" value="tan" onclick="alltx(this.value)"/></td>
</tr>

<!-- M+ 0 +/- . + = -->
<tr>
<td width="13%" height="38" align="center"><input style="color:#F00" type="button" value="M+" class="bt" onclick="checkallM(this.value)"/></td>
<td width="16%" height="38" align="center"><input style="color:#00F" name="button16" type="button" class="bt" id="button16" value="0" onclick="number(this.value)"/></td>
<td width="14%" height="38" align="center"><input style="color:#00F" name="button17" type="button" class="bt" id="button17" value="+/-" onclick="alltx(this.value)"/></td>
<td width="14%" align="center"><input style="color:#00F" name="button18" type="button" class="bt" id="button18" value="." onclick="point()"/></td>
<td width="13%" align="center"><input style="color:#F00" name="button19" type="button" class="bt" id="button19" value="+" onclick="allfhao(this.value)" /></td>
<td width="14%" align="center"><input style="color:#F00" name="button22" type="button" class="bt" id="button22" value="=" onclick="sum()"/></td>
<td width="16%" align="center"><input style="color:#00F" name="button27" type="button" class="bt" id="button27" value="pi" onclick="alltx(this.value)"/></td>
</tr>

</table>
</td></tr></table>
</div>

</FORM>
</div>
</body>
</html>

⑼ 怎麼樣可以實現一個網頁版的計算器,只做加法的

<! html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<table>
<tr>
<td><input type="button" value="add" onclick="setOp('+', 'add');"/></td>
<td><input type="button" value="miner" onclick="setOp('-', 'miner');"/></td>
<td><input type="button" value="times" onclick="setOp('*', 'times');"/></td>
<td><input type="button" value="divide" onclick="setOp('/', 'divide');"/></td>
</tr>
</table>
<table id="tb_calc" style="display:none;">
<tr>
<td> <input id="x" type="text" style="width:100px" value="" name="x" /></td>
<td> <lable id="op" name="op"></lable> </td>
<td> <input id="y" type="text" style="width:100px" value="" name="y" /> </td>
<td> <input id="opTips" type="button" value="" onclick="calc();"/> </td>
<td> <lable id="z" name="z"></lable> </td>
</tr>
</table>
<script type="application/javascript">
function setOp(op, opTips)
{
var tb=document.getElementById("tb_calc");
tb.style.display = "none";

document.getElementById("x").value = "";
document.getElementById("y").value = "";
document.getElementById("z").innerText = "";
document.getElementById("op").innerText = op;
document.getElementById("opTips").value = opTips;

tb.style.display = "block";
}
function calc()
{
var x = parseInt(document.getElementById("x").value);
var y = parseInt(document.getElementById("y").value);
var op = document.getElementById("op").innerText;

var z = "";
switch(op)
{
case '+':
z = x + y;
break;

⑽ 用css js做一個網頁版的計算器,要有加減乘除運算,和歸零刪除鍵

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>計數器</title>
</head>
<body>
<input type="text" name="text" id="pre" onblur="validate(this.value);">
<select id="operator">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="text" name="text" id="next" onblur="validate(this.value);">
<span>=</span>
<input type="text" id="result" readonly="true">
<input type="button" id="btn" value="提交" onclick="calculator();">
<script>
function validate(str){
var reg = /^\d+$/;
if (!reg.test(str)) {
alert("請輸入數字");
}
}
function calculator(){
var pre=document.getElementById("pre").value;
var next=document.getElementById("next").value;
var opra=document.getElementById("operator").value;

var result=0;
switch(opra) {
case "+":
result=parseInt(pre)+parseInt(next);
break;
case "-":
result=parseInt(pre)-parseInt(next);
break;
case "*":
result=parseInt(pre)*parseInt(next);
break;
case "/":
if(parseInt(next)!=0){
result=parseInt(pre)/parseInt(next);
}
else{
alert("除數不能為0");
return;
}
break;
default:
break;
}
document.getElementById("result").value=result;
}
</script>
</body>
</html>