网页计算器(用C#或Editplus)

来源:百度知道 编辑:UC知道 时间:2024/06/06 19:17:07
网页计算器:实现简单的+-*/即可,10个数字按钮,4个操作按钮,一个=号按钮,一个重置按钮,一个TextBox显示数据。

<!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=gb2312" />
<title>无标题文档</title>
</head>
<script>

var smg="";
function ad(x){
smg=smg+x.value;
from1.name1.value=smg;

}

function add(){
from1.name2.value=eval(smg);
}
function clear1(){
smg="";
from1.name1.value="";
from1.name2.value="";
}
</script>

<body><form name="from1">