明经CAD社区

 找回密码
 注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 114|回复: 0

[资源] 超文本标记语言(Hyper Text Markup Language)收集学习

[复制链接]
发表于 2019-7-19 12:39 | 显示全部楼层 |阅读模式
本帖最后由 1291500406 于 2019-7-19 12:58 编辑


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title> 计算器</title>
<script>
var tmp=0;
function add(x,y){
return Number(x) + Number(y);
}
function getresult(){
var x = document.getElementById("button0").value;
var y = document.getElementById("button0").value;
var re = add(x,y);
document.getElementById("txt1").value = re;
}
function getNumber(obj){
var str = document.getElementById("txt1").value;
document.getElementById("txt1").value = str + obj.value;
}
</script>
</head>
<body>
<table border="1" align="center">
<caption>
<input type="text" id="txt1" style="text-align:right"/>
<input type="text" id="txt2" style="display:none"/>
<table class=1>
<tr>
<td><input type="button" id="button7" value="7"></td>
<td><input type="button" id="button8" value="8"></td>
<td><input type="button" id="button9" value="9"></td>
<td><input type="button" id="button*" value="*"></td>
</tr>
<tr>
<td><input type="button" id="button4" value="4"></td>
<td><input type="button" id="button5" value="5"></td>
<td><input type="button" id="button6" value="6"></td>
<td><input type="button" id="button-" value="-"></td>
</tr>
<tr>
<td><input type="button" id="button1" value="1"></td>
<td><input type="button" id="button2" value="2"></td>
<td><input type="button" id="button3" value="3"></td>
<td><input type="button" id="Button13" value="+" /></td>
</tr>
<tr>
<td><input type="button" id="button0" value="0"></td>
<td><input type="button" id="button." value="."></td>
<td><input type="button" id="button=" value="="></td>
<td><input type="button" id="button/" value="/"></td>
</tr>
</table>
</body>
</html>
<script>
var tmp=0;
function add(x){
var sum =eval(x);
return sum;
}
function getresult(){
var x = document.getElementById("txt1").value;
var re = add(x);
document.getElementById("txt1").value = re;
}
function getNumber(obj){
var str = document.getElementById("txt1").value;
document.getElementById("txt1").value = str + obj.value;
}
</script>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号  
©2000-2017 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2019-8-26 00:19 , Processed in 0.170298 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表