用HTML+CSS+JS实现一个简易的计算器:

<html>
<head>
<title>小粉兔计算器</title><style>form.formtotal{background-image:url("file:///C:/Users/86136/Desktop/cute.jpg");height:400px;width:400px;}div.divone{float:left;height:97%;width:60%;margin:6px;}input[type="text"]{font-size:x-large;float:left;width:235px; height:50px;border-radius: 13px;background-color:#FFF7FB;outline:none;}input[type="button"].btnone{font-size:large;font-family:"华文行楷";width:29%;height:20%;border-radius: 13px;background-color:#FFECF5;margin-top:7px;margin-left:4px;cursor:pointer;outline:none;}div.divtwo{float:right;width:34%;height:97%;margin:6px;}input[type="button"].backspace{font-family:"华文行楷";font-size:x-large;float:left;width:48%;height:50px;border-radius: 13px;background-color:#FFECF5;cursor:pointer;outline:none;}input[type="button"].delete{font-family:"华文行楷";font-size:x-large;float:right;width:48%;height:50px;border-radius: 13px;background-color:#FFECF5;cursor:pointer;outline:none;}input[type="button"].btntwo{font-family:"华文行楷";font-size:x-large;width:85%;height:20%;border-radius: 13px;background-color:#FFECF5;margin-top:7px;margin-left:10px;cursor:pointer;outline:none;}input[type="button"]:hover {background-color: #FFECF5;}</style>
</head><body><form class="formtotal"><div class="divone"><input type="text" class="txt" id="textshow" /> <input type="button" class="btnone" id="btn" value="1" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="2" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="3" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="4" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="5" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="6" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="7" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="8" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="9" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="0" onclick="caclufunction(this.value)"/><input type="button" class="btnone" id="btn" value="." onclick="caclufunction(this.value)"/><input type="button" class="btnone id="btn" value="="  οnclick="caclufunction(this.value)"/></div><div class="divtwo"><input type="button" class="delete" id="btn" value="C" onclick="caclufunction(this.value)"/><input type="button" class="backspace" id="btn" value="back" onclick="caclufunction(this.value)"/><input type="button" class="btntwo" id="btn" value="+" onclick="caclufunction(this.value)"/><input type="button" class="btntwo" id="btn" value="-" onclick="caclufunction(this.value)"/><input type="button" class="btntwo" id="btn" value="*" onclick="caclufunction(this.value)"/><input type="button" class="btntwo" id="btn" value="/" onclick="caclufunction(this.value)"/></div></form><script>function  caclufunction(val){var num = document.getElementById("textshow");switch (val) {case "back":num.value=num.value.substring(0,num.value.length-1);break;case "=":num.value = eval(num.value);break;case "C":num.value = "";break;default:num.value = num.value + val;break;}}</script>
</body>
</html>

小粉兔简易计算器——一只小巨子相关推荐

  1. js 月份间隔计算器_15分钟用JS做一个简易计算器

    原标题:15分钟用JS做一个简易计算器 前言 这个小练手旨在帮助刚上手学习Java的同学练习最基本的Js知识,大神勿喷哈,由于这个是非常简易的计算器,可以完成的功能有加减乘除和AC(清屏),DEL(退 ...

  2. 简单的android小程序计算机,Android实现简易计算器小程序

    本文实例为大家分享了Android实现简易计算器小程序的具体代码,供大家参考,具体内容如下 目标效果: 通过编写代码,可以实现整数和小数的加减乘除运算,以及删除和清空的功能. 1.页面中Button使 ...

  3. Java程序设计 图形用户界面 小巫版简易计算器

    /** 作者:wwj 时间:2012/4/13 功能:实现一个计算器应用程序实验要求:编写一个模拟计算器的应用程序,使用面板和网格布局, 添加一个文本框,10个数字按钮(0~9),4个加减乘除按钮, ...

  4. 微信小程序-简易计算器

    代码地址如下: http://www.demodashi.com/demo/14210.html 一.前期准备工作 软件环境:微信开发者工具 官方下载地址:https://mp.weixin.qq.c ...

  5. Android小程序-简易计算器的实现

    目标效果:   通过编写代码,可以实现整数和小数的加减乘除运算,以及删除和清空的功能. 1.页面中Button使用的是线性布局,最外边一个是父布局,第一行C,DEL,/,*为第一个子布局,第二行7,8 ...

  6. python中用于释放类占用的资源的方法是()_编写一个简易计算器,要求根据输入的数字和四则运算符号,计算运算结果并输出。_学小易找答案...

    [简答题]20191220 课前作业 新工作页4.1的3-5-3页的填空题,参考教材P135-P144 [简答题]AutoCAD改编视图,尽量不用虚线 1. 主视图采用局部剖,表达右上角小圆筒(及孔) ...

  7. 微信小程序开发之简易计算器

    微信小程序之简易计算器 一.介绍 1.中缀表达式 中缀表达式是一种通用的算术或逻辑公式表示方法,操作符以中缀形式处于操作数的中间.中缀表达式是人们常用的算术表示方法. 虽然人的大脑很容易理解与分析中缀 ...

  8. 微信小程序--简易计算器

    一.项目概述 本文主要介绍了微信小程序的一个简易计算器的实现代码实例. 实现的功能有: 实现简单的加减乘除 删除 全部清空 小程序页面目录如下: 计算器页面如下: 二.WXML文件编写 首先我们对计算 ...

  9. vue简易计算器小案例09

    简易计算器小案例 逻辑部分没有完全实现,主要用来练手,加强理解父子组件之间的通信过程. 效果: 简易计算器代码 counter.html <!DOCTYPE html> <html ...

最新文章

  1. win设置计算机网络,Win10怎么修改网络类型,Win10网络类型怎么设置?
  2. 图形处理(七)基于热传播的测地距离计算-Siggraph 2013
  3. 12月16日要做的事
  4. 计算机系统组装 维护常用工具及其作用,《计算机系统组装维护》课程实用标准.doc...
  5. orm提取指定列_使用ORM提取数据很容易! 是吗?
  6. CCF 201412-2 Z字形扫描
  7. Meteor 加入账户系统
  8. python中的不可变对象_python中的可变与不可变对象
  9. Spark SQL External DataSource外部数据源操作流程
  10. frdora10_a8_linux,硬盘安装fedora10
  11. linux硬盘检测工具,利用Smartmontools工具检测Linux硬盘状况 – 安装及基本应用 | 老左笔记...
  12. 离散数学期末复习知识总结
  13. 【解决方法】如何压缩网页字体文件
  14. python推理拟合函数
  15. java testsuite_JUnit —— TestSuite 的使用
  16. 【简单图形解释】刚体上任意一点速度与刚体角速度的关系
  17. codeforces 794E Choosing Carrot
  18. 『福利』免费领取官方提供的Atlas云托管MongoDB
  19. Drupal7_1:初识drupal
  20. 直觉模糊熵的多属性决策及matlab应用

热门文章

  1. AI养猪,国标GB28181协议视频平台EasyGBS流媒体服务器携手RTMP流媒体服务器EasyDSS协同打造智慧养殖生态圈
  2. 华为eNSP vlan综合实验
  3. 2023年湖北中级工程师在哪里评审?秋禾火
  4. 5个简单又实用的Excel鼠标双击技巧
  5. java高内聚低耦合什么意思_高内聚低耦合的理解
  6. OpenStack——glance
  7. linux监听一个端口命令,linux监听端口命令
  8. ea服务器显示时间不合适,电脑时间不对怎么办
  9. win10 64bit+ qt5.12.0 + msvc2017 + libtorch(pytorch)+cuda10.1+cudnn7.6配置
  10. 自动驾驶的社会交互的综述和思考