從制造到創(chuàng)造
          軟件工程師成長之路
          posts - 292,  comments - 96,  trackbacks - 0
          <html>
              
          <head>
                  
          <script language="javascript">
                      
          var rowIndex = 0;
                      
                      
          function addOneLineOnClick() {
                          
          var row = tb.insertRow(tb.rows.length);
                          col 
          = row.insertCell(0);
                          col.innerHTML 
          = "<tr><input size='90'  name=btn index=\""+ rowIndex +"\" >";
                          col 
          = row.insertCell(1);
                          col.innerHTML 
          = "<input type='button' value='Del'  onclick=\"return DeleteRow('row" + rowIndex +"')\"></tr>";
                          row.setAttribute(
          "id""row" + rowIndex);
                          row.setAttribute(
          "name""row" + rowIndex);
                          rowIndex
          ++;
                      }

                      
          function DeleteRow(rowTag){
                          
          var i = tb.rows(rowTag).rowIndex;
                          
          var j;
                          
          for(j=i;j<=rowIndex;j++) { 
                              tb.rows(j).cells(
          0).all("btn").index--
                          }
                          tb.deleteRow(i);
                          rowIndex
          --;
                      }
                  
          </script>
              
          </head>
              
          <body >
                  
          <div align="center">            
                      
          <table width="95%" name="tb" id="tb">
                          
          <tr>
                          
          </tr>
                      
          </table>
                      
          <p>            
                      
          <input name="btnAddLine" type="button" id="btnAddLine" onClick="return addOneLineOnClick()" value="Add">
                  
          </div>
              
          </body>
          </html>
          posted on 2007-10-09 10:14 CoderDream 閱讀(337) 評論(0)  編輯  收藏 所屬分類: JavaScript

          <2007年10月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          常用鏈接

          留言簿(9)

          我參與的團隊

          隨筆分類(245)

          隨筆檔案(239)

          文章分類(3)

          文章檔案(3)

          收藏夾(576)

          友情鏈接

          搜索

          •  

          積分與排名

          • 積分 - 458376
          • 排名 - 114

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 弋阳县| 鄂托克前旗| 新津县| 宁乡县| 金坛市| 禹州市| 保康县| 昭平县| 陆河县| 陇川县| 奉新县| 高邮市| 汉沽区| 甘谷县| 金乡县| 永吉县| 紫阳县| 海盐县| 三河市| 柘城县| 沁水县| 罗田县| 内丘县| 商洛市| 定州市| 额济纳旗| 海南省| 噶尔县| 元氏县| 长岭县| 祁东县| 柘城县| 泸水县| 来宾市| 沐川县| 于都县| 保康县| 榆树市| 平利县| 石首市| 陈巴尔虎旗|