计算器网页效果显示:点击这里!

<script> 

function show(){ 

var date = new Date(); //日期对象 

var now = ""; 

now = date.getFullYear()+"年"; //读英文即可了 

now = now + (date.getMonth()+1)+"月"; //取月的时候取的是当前月-1假设想取当前月+1就能够了 

now = now + date.getDate()+"日"; 

now = now + date.getHours()+"时"; 

now = now + date.getMinutes()+"分"; 

now = now + date.getSeconds()+"秒"; 

document.getElementById("nowDiv").innerHTML = now; //div的html是now这个字符串 

setTimeout("show()",1000); //设置过1000毫秒就是1秒,调用show方法 



</script>





<!DOCTYPE html> 

<html> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<head> 

<title>Calculator</title> 





<!--将按键内容以字符串形式存储在文字框中当button为“=”时。调用eval方法计算结果然后将结果输出文字框中--> 

<script type="text/javascript"> 

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; 



</script> 





<style type="text/css">

img{

  position:absolute;

  left:1100px;

  top:100px;

  }

</style>

</head> 

<body>   <!用来显示时间>

<h2 align=right><font color="#cc0033">

<body onload="show()">   <!-- 网页载入时调用一次 以后就自己主动调用了--> 

<div id="nowDiv"></div> 

</font></h2>

</body>

<body bgcolor="#9900ff" > 

<a  href="../index.html"><img border="0" src="./image/4.jpg" alt="主页面" title="返回主页面"></a>





<font color="red" size="6"><center>网络人VS灰鸽子工作室</center></font>

<p></p>

<!--定义按键表格,每一个按键相应一个事件触发--> 

<table border="1" align="center" bgColor="#6633CC" 

style="height: 350px; width: 270px"> 

<tr> 

<td colspan="4"> 

<input type="text" id="nummessege" 

style="height: 90px; width: 350px; font-size: 50px" /> 

</td> 

</tr> 

<tr> 

<td> 

<input type="button" value="1" id="1" onclick="onclicknum(1)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="2" id="2" onclick="onclicknum(2)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="3" id="3" onclick="onclicknum(3)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="+" id="add" onclick="onclicknum('+')" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

</tr> 

<tr> 

<td> 

<input type="button" value="4" id="4" onclick="onclicknum(4)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="5" id="5" onclick="onclicknum(5)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="6" id="6" onclick="onclicknum(6)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="-" id="sub" onclick="onclicknum('-')" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

</tr> 

<tr> 

<td> 

<input type="button" value="7" id="7" onclick="onclicknum(7)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="8" id="8" onclick="onclicknum(8)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="9" id="9" onclick="onclicknum(9)" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="*" id="mul" onclick="onclicknum('*')" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

</tr> 

<tr> 

<td colspan="2"> 

<input type="button" value="0" id="0" onclick="onclicknum(0)" 

style="height: 70px; width: 190px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="." id="point" onclick="onclicknum('.')" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

<td> 

<input type="button" value="/" id="division" 

onclick="onclicknum('/')" 

style="height: 70px; width: 90px; font-size: 35px"> 

</td> 

</tr> 

<tr> 

<td colspan="2"> 

<input type="button" value="Del" id="clear" 

onclick="onclickclear()" 

style="height: 70px; width: 190px; font-size: 35px" /> 

</td> 

<td colspan="2"> 

<input type="button" value="=" id="result" 

onclick="onclickresult()" 

style="height: 70px; width: 190px; font-size: 35px" /> 

</td> 

</tr> 

</table> 

    <font size="5" color="ff99ff">Design by:<a target="_blank" href="http://blog.csdn.net/qq_21792169/article/details/50629515"
>网络人VS灰鸽子</a> 2016-3-3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮箱:linux_drv@yeah.net</font>

<! 这里为了方便我就直接加入空格来布局了,这里能够使用style>

</body> 

</html>

HTML网页之计算器代码的更多相关文章

  1. Bootstrap css栅格 + 网页中插入代码+css表格

    设计达人 http://www.shejidaren.com/30-minimal-app-icons.html CSS栅格: <!DOCTYPE html> <html lang= ...

  2. 网页嵌入WMP代码(转)

    网页嵌入WMP代码 播放器代码解释,装了9.0或9.0以上的播放器才能正常使用: OBJECT id="WMP" height="176" width=&quo ...

  3. 总结PHP中几种常用的网页跳转代码

    网页跳转的意思就是指当你在浏览器中访问A页面时,会自动跳转到B页面,往往网页跳转用在404页面中会比较多点.至于怎么实现网页跳转,网上已经提供了很多的方法,有些方法是不可行的,经过测试,叶德华今天就在 ...

  4. python爬取网页的通用代码框架

    python爬取网页的通用代码框架: def getHTMLText(url):#参数code缺省值为‘utf-8’(编码方式) try: r=requests.get(url,timeout=30) ...

  5. spring-mvc实现模拟数据到网页展示过程代码

    spring-mvc实现模拟数据到网页展示过程代码 先看看我们的3种模拟数据到网页展示的思路图: 1.当mybatis的环境配置完成.一个动态Web项目建立好.开始导入jar包. -spring的ao ...

  6. C#和网页js互调代码

    C#和网页js互调代码 1.先写个网页放在主程序目录下:test.html <!DOCTYPE html> <html lang="en" xmlns=" ...

  7. js加减乘除在线计算器代码

    js加减乘除在线计算器代码 在线演示本地下载

  8. 四种ASP网页跳转代码

    时间:2012-06-12 21:12来源:未知 输入:铜都风尘 点击: 32987 次 如果你要在服务器端跳转,可以这样: Response.Redirect(http://blog.163.com ...

  9. 73种网页常用Javascript代码

    73种网页常用Javascript代码 转载自:前端丶灵魂工程师   1.后退 前进  <input type="button" value="后退" o ...

随机推荐

  1. Hadoop基础(一)

    Hadoop 基础知识 大数据已经火了很长很长时间了,从最开始是个公司都说自己公司的数据量很大,我们在搞大数据.到现在大数据真的已经非常成熟并且已经在逐渐的影响我们的生产生活.你可能听过支付宝的金融大 ...

  2. centos7安装mysql和mysql-connector-c++

    最近为了搭建自己的开发环境,又一次在centos7上面开始安装mysql和c++的访问环境,特此记录一下搭建过程,方便以后查阅 一.安装mysql centos7 默认安装了mariaDB,导致不能安 ...

  3. 【转】Centos7 ftp 配置及报错处理

    原文链接: https://www.cnblogs.com/GaZeon/p/5393853.html Centos7网络配置,vsftpd安装及530报错解决 今天在虚拟机安装CentOS7,准备全 ...

  4. Google开源技术protobuf

    1.protobuf简介 protobuf是google提供的一个开源序列化框架,类似于XML,JSON这样的数据表示语言,其最大的特点是基于二进制,因此比传统的XML表示高效短小得多.虽然是二进制数 ...

  5. flask web开发日记

    from flask import Flask,make_response,redirect,abort app = Flask(__name__) @app.route('/index1') def ...

  6. 64位windows系统如何显示32位dcom组件配置

    在运行栏中输入命令:dcomcnfg,打开组件服务管理窗口,但是却发现找不到Microsoft Excel程序,这主要是64位系统的问题,excel是32位的组件,所以在正常的系统组件服务里是看不到的 ...

  7. 剔除重复jar包,查找重复类

    作为程序员,没有遇到过jar包冲突,不是你幸运,就是你还年轻. jar包冲突有着无穷的魔力,一提到就会有说不完的怨愤,道不清的忧伤,这都是内伤.jar 包冲突就像深藏地底的地雷,看上去平常无奇,一切是 ...

  8. MyBatis入门3_mapper.xml优化(parameterType简写_NameSpace简写_sql片段_特殊字符处理)_动态SQL

    本文为博主辛苦总结,希望自己以后返回来看的时候理解更深刻,也希望可以起到帮助初学者的作用. 转载请注明 出自 : luogg的博客园 谢谢配合! 优化 1.起别名(一般不用,写全方便查看类出处) 以前 ...

  9. (转)分布式文件存储FastDFS(五)FastDFS常用命令总结

    http://blog.csdn.net/xingjiarong/article/details/50561471 1.启动FastDFS tracker: /usr/local/bin/fdfs_t ...

  10. 转:LINQ教程一:LINQ简介

    原文地址:https://www.cnblogs.com/dotnet261010/p/8278793.html 一.为什么要使用LINQ 要理解为什么使用LINQ,先来看下面一个例子.假设有一个整数 ...