從制造到創造
          軟件工程師成長之路
          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 閱讀(355) 評論(0)  編輯  收藏 所屬分類: JavaScript

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

          常用鏈接

          留言簿(9)

          我參與的團隊

          隨筆分類(245)

          隨筆檔案(239)

          文章分類(3)

          文章檔案(3)

          收藏夾(576)

          友情鏈接

          搜索

          •  

          積分與排名

          • 積分 - 459731
          • 排名 - 114

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 闽侯县| 罗平县| 肇东市| 永州市| 白银市| 南京市| 曲沃县| 永德县| 浦江县| 漳平市| 乃东县| 顺平县| 凤冈县| 巧家县| 宜宾县| 湾仔区| 宜丰县| 东方市| 舟曲县| 玉田县| 建平县| 德清县| 徐闻县| 鄂州市| 云浮市| 寻乌县| 元谋县| 孟村| 大足县| 卢氏县| 鹿邑县| 宁河县| 韩城市| 太白县| 普格县| 阜新市| 贺兰县| 德钦县| 张家川| 蚌埠市| 铜陵市|