看下面怎么完成!减-乘-除
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
var jsvalue = 0;
var vala = 0;
var valb = 0;
function jsfunc(obj)//定义一个函数
{
var pubvalue = document.getElementById("pubvalue");//变量用于PUB..是文本显示的是docu..ID(参数)是下面事件点出来的
switch(obj.name)//循环对象的名字
{
//点数调用的函数
case "seven"://案例
pubvalue.value = pubvalue.value+"7";
break;
case "eight":
pubvalue.value = pubvalue.value+"8";
break;
case "nine":
pubvalue.value = pubvalue.value+"9";
break;
case "four":
pubvalue.value = pubvalue.value+"4";
break;
case "five":
pubvalue.value = pubvalue.value+"5";
break;
case "six":
pubvalue.value = pubvalue.value+"6";
break;
case "one":
pubvalue.value = pubvalue.value+"1";
break;
case "tow":
pubvalue.value = pubvalue.value+"2";
break;
case "three":
pubvalue.value = pubvalue.value+"3";
break;
case "zero":
pubvalue.value = pubvalue.value+"0";
break;
}
}
function addval()
{
//+号调用的函数
vala = document.getElementById("pubvalue").value;
document.getElementById("pubvalue").value = '';
}
function dengyu()
{
//确认调用的函数
if(document.getElementById("pubvalue").value=='')
{
alert("请输出要计算的值!");
return;
}
var va = document.getElementById("pubvalue").value;
var vb = parseInt(vala)+parseInt(va);
document.getElementById("pubvalue").value = vb;
}
function aaa()
{
//-号的调用
valb = document.getELementById('pubvalue').value;
document.getElementById("pubvalue").value = '';
}
function bbb()
{
//确认调用
if (document.getElementById("pubvalue").value=='')
{
alert("请输出要计算的值!");
return;
}
var vv = document.getElementById("pubvalue").value;
var vc = parseInt(valb)-parseInt(vv);
document.getElementById("pubvalue").value = '';
}
</SCRIPT>
</HEAD>
<form name='form'>
<BODY>
<div style="width:300px;padding:20px;overflow:hidden;word-wrap:break-word;word-break:break:all; font-size:12px; line-height:18px; background-color:#eeeeee;">
<font disabled>
<!-- 设置表格 -->
<table align='center' border='5' bordercolor='#CCFFFF' cellpadding='1' cellspacing='5'>
<tr>
<!-- 文 本 框 -->
<td colspan=3 align=middle><input type='text' name='text1' id='pubvalue'>
<!-- 按 钮 -->
<tr><td><input type='button' name='button1' onclick = "addval()" value='[ + ]' >
<input type='button' name='button2' onclick='aaa()' value='[ - ]' > <input type='button' name='button3' onclick='addvbl()' value='[ * ]' >
<input type='button' name='button4' value='[ / ]' >
</tr>
<tr><td><input type='button' value='[ 7 ]' name='seven' onclick="jsfunc(this)">
<input type='button' value='[ 8 ]' name='eight' onclick="jsfunc(this)">
<input type='button' value='[ 9 ]' name='nine' onclick="jsfunc(this)">
<input type='reset' value='重 置'>
</tr>
<tr>
<td><input type='button' value='[ 4 ]' name='four' onclick="jsfunc(this)">
<input type='button' value='[ 5 ]' name='five' onclick="jsfunc(this)">
<input type='button' value='[ 6 ]' name='six' onclick="jsfunc(this)">
<input type='reset' value='为 零'>
</tr>
<tr>
<td><input type='button' value='[ 1 ]' name='one'onclick="jsfunc(this)">
<input type='button' value='[ 2 ]' name='tow' onclick="jsfunc(this)">
<input type='button' value='[ 3 ]' name='three' onclick="jsfunc(this)">
<input type='button' value='姜 岩'>
</tr>
<tr>
<td><input type='button' value='[ 0 ]' name='zero' onclick="jsfunc(this)">
<input type='button' value='[ . ]' >
<input type='button' value='[等=]' onclick="dengyu()" >
<input type='button' value='亲 笔'>
</div>
</tr>
</table>
</form>