從制造到創造
          軟件工程師成長之路
          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)

          友情鏈接

          搜索

          •  

          積分與排名

          • 積分 - 459735
          • 排名 - 114

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 澜沧| 江津市| 万年县| 秭归县| 岳阳县| 金秀| 广丰县| 全椒县| 万盛区| 阜康市| 清徐县| 桐乡市| 南乐县| 马山县| 高州市| 萨迦县| 金沙县| 广东省| 平果县| 南丰县| 武义县| 观塘区| 元朗区| 安阳县| 新余市| 景谷| 襄城县| 观塘区| 古丈县| 五寨县| 股票| 山东省| 大兴区| 全州县| 油尖旺区| 晋江市| 大竹县| 昭觉县| 南和县| 全南县| 长兴县|