主要就是有颜色的句子不明白,请帮忙看下,谢谢了
<head>
       <title>A simple calculator</title>
      
       <script type = "text/javascript">
          <!--         function doit() {
            form.input.value = eval(form.input.value)
          }
                                         
       </script>
       
     </head>      <body>
         <form name = "form" action = "">
         
         <table border = "1" width = "450" cellspacing = "5"
            summary = "This is a calculator used to calculate simple mathematics operations">         <caption>Simple Calculator</caption>            <thead></thead>
            
            
             <tbody>
               <tr>
                  <td colspan = "3" height = "15">
                     <input name = "input" type = "text" size = "32"></td>
               </tr>                <tr>
                   <td width = "60" height = "15">
                      <input name = "one" type = "button" value = "   1   "
                      onClick = "form.input.value += '1'" /></td>
                   <td width = "60" height = "15">
                      <input name = "two" type = "button" value = "   2   "
                      onClick = "form.input.value += '2'" /></td>
                   <td width = "60" height = "15">
                      <input name = "three" type = "button" value = "   3   "
                      onClick = "form.input.value += '3'" /></td>
                   <td width = "1" height = "15"></td>
                   <td width = "60" height = "15">
                      <input name = "MultiplySign" type = "button" value = "    *    "
                      onClick = "form.input.value += '*'" /></td>   
                </tr>
                               <tr>
                   <td width = "60" height = "15"> 
                      <input name = "equal" type = "button" value = "   =   "
                      onClick = "doit()" /></td>  
                </tr>  
            
          </table>
       </form> 
    </body>

解决方案 »

  1.   

    form.input.value += '1'
    相当于在form.input.value =  form.input.value + '1'
    意思是在原来的基础上加1
      

  2.   

    将原先的value后追加(1,2,3,*)
      

  3.   

    不好意思,可能是我没有说明白
    这是一个计算器代码的一部分,我给截出来了,这样还少点
    我不明白的是这个计算器的工作原理,也就是怎么能把数给算出来的呢
    <input name = "one" type = "button" value = " 1 "
      onClick = "form.input.value += '1'" /></td>
    就想上边的代码,一这个按钮的VALUE不应该是 FORM.ONE.VALUE吗
      

  4.   

    这个form.input.value 指的是这个 <input name = "input" type = "text" size = "32">的value,按钮的value值只是做显示用,显示在按钮的表面,当然他的功能,就是onClick里面执行的,把上面那个input的值改变。
      

  5.   

    <input name = "one" type = "button" value = " 1 "
      onClick = "form.input.value += '1'" /></td>
    这个onClick方法所改变的是
    <input name = "input" type = "text" size = "32"></td>
    这个文本框的值,而form.input.value += '1'意思是在每次按下改按钮时,
    <input name = "input" type = "text" size = "32"></td>
    改文本框显示的值自动追加1,如原来是1,那么按一下就变11,依次类推其他按钮的方法是一样的功能