</html>
<head>
<title>计算器</title>
<script type="text/javascript">
function enter(obj, string)
{obj.expr.value += string}
function compute(obj)
{obj.expr.value =eval (obj.expr.value)}
var one = '1'
var two= '2'
var plus= '+'
</script>
</head>
<body>
<form>
<input type="text" name="expr" size=30 action="compute(this.form)"> <tr>
<input type="button" value=" 1 " onClick="enter(this.form, one)">
<input type="button" value=" 2 " onClick="enter(this.form, two)">
<input type="button" value=" + " onClick="enter(this.form, plus)">
<input type="button" value=" = " onClick="compute(this.form)">
</form>
</body>
</html>
具体就是解释下这个this.form跟上面函数的逻辑关系,还有this form具体是干吗的
还有这个程序的算法的逻辑 就是比如说我按了一个1,触发了什么什么.调用了哪个函数什么什么的.到算出这个结果.这个中间的过程希望能讲清楚