1、網頁製作,,,公式計算器
我做了個簡單的 你先拿去用吧。
把代碼粘貼到html文件裡面就好了。
純手打的 望採納。
——————————————————代碼—————————————————
<html>
<head>
<title>Caculator</title>
</head>
<body>
<table>
<tr>
<td>單價:</td><td><input type="text" id="sPrice" value="" /></td>
</tr>
<tr>
<td>數量:</td><td><input type="text" id="Num" value=""/></td>
</tr>
<tr>
<td>總價:</td><td><input type="text" id="TPrice" value=""/></td>
</tr>
<tr>
<td><input type="button" id="cacul" value="計算" onclick="cal();"/></td>
</tr>
</table>
</body>
<script type="text/javascript">
function cal(){
var sPrice = document.getElementById('sPrice').value;
var Num = document.getElementById('Num').value;
var TPrice= document.getElementById('TPrice').value;
if(sPrice!=''&&Num!=''){
TPrice = sPrice*Num;
document.getElementById('TPrice').value = TPrice;
}
if(Num==0&&TPrice!=''){
alert('除數不能為零!');
}
if(TPrice!=''&&Num!=''&&Num!=0){
sPrice = TPrice/Num;
document.getElementById('sPrice').value = sPrice;
}
}
</script>
</html>
2、用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>
3、網頁計算器設計
我寫了個簡單的```你要的那些都有````附件
4、如何用運用html和css相關技術,設計一個網頁在線計算器的界面
html+css只是靜態樣式。而涉及到計算方面,得再加js就能實現了。
5、網頁製作--如何製作計數器?
Microsoft Frontpage有現成的.將它插入到你所希望的位置即可.
6、在自己電腦上設計的網頁計算器,如何操作可以讓別人通過手機打開?急,求大神指教。
將網頁上傳到網站,然後將這個網頁的地址發給對方,對方就可以用手機打開了
7、簡單的網頁計算器製作,是不是我代碼寫錯了,怎麼顯示的是不完整的呢?
添加點樣式,或者表格來調整位置。
8、網頁設計與製作設計一個頁面,實現一個四則計算器
這個代碼其實網上有很多現成的,而且做有CSS布局各種形式的都有,自己多花點時間搜索下就可以找到 。