Tip: You can modify some of the code before running
<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> a more common calculator </title> </pead> <body> <script language=" JavaScript "> <!--Hide the script from old browsers--function compute (obj) {obj.expr.value = eval (obj.expr. Value)} var one = ' 1 ' var two = ' 2 ' var three = ' 3 ' var four = ' 4 ' var five = ' 5 ' var six = ' 6 ' var seven = ' 7 ' VA R eight = ' 8 ' var nine = ' 9 ' var zero = ' 0 ' var plus = ' + ' var minus = '-' var multiply = ' * ' var divide = '/' var decimal = '. ' function enter (obj, string) {Obj.expr.value = = string} function clear (obj) {obj.expr.value = '}//--end Hidi ng here--> </script> <form name= "Calc" > <table border=1> <td Colspan=4><input "Tex T "name=" expr "size=30 action=" compute (this.form) "> <tr> <td><input type=" button "value=" 7 "OnClick = "Enter (This.form, seven)" > <td><input type= "butTon "value=" 8 "onclick=" Enter (This.form, eight) "> <td><input type=" button "value=" 9 "onclick=" Enter (t His.form, nine) "> <td><input type=" button "value="/"onclick=" Enter (This.form, divide) "> <tr>& Lt;td><input type= "button" value= "4" onclick= "Enter (This.form, four)" > <td><input type= "button" Val Ue= "5" onclick= "Enter (This.form, five)" > <td><input type= "button" value= "6" onclick= "Enter (This.form, Six) "> <td><input type=" button "value=" * "onclick=" enter (this.form, multiply) "> <tr><td> <input type= "button" value= "1" onclick= "Enter (This.form, one)" > <td><input type= "button" value= "2" onclick= "Enter (This.form, two)" > <td><input type= "button" value= "3" onclick= "Enter (This.form, three)" " ; <td><input type= "button" value= "-" onclick= "Enter (This.form, minus)" > <tr><td colspan=2>< Input type= "button" VAlue= "0" onclick= "Enter (This.form, zero)" > <td><input type= "button" value= ". "Onclick=" Enter (This.form, decimal) "> <td><input type=" button "value=" + "onclick=" Enter (This.form, plus) "> <tr><td colspan=2><input type=" button "value=" = "onclick=" Compute (this.form) "> <TD cols Pan=2><input type= "button" value= "AC" size= 3 onclick= "Clear (this.form)" > </table> </form> </b Ody> </ptml>
Tip: You can modify some of the code before running