從制造到創(chuàng)造
          軟件工程師成長(zhǎ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 閱讀(350) 評(píng)論(0)  編輯  收藏 所屬分類: JavaScript

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

          常用鏈接

          留言簿(9)

          我參與的團(tuán)隊(duì)

          隨筆分類(245)

          隨筆檔案(239)

          文章分類(3)

          文章檔案(3)

          收藏夾(576)

          友情鏈接

          搜索

          •  

          積分與排名

          • 積分 - 459358
          • 排名 - 114

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 乐昌市| 永川市| 武邑县| 正阳县| 新郑市| 金塔县| 余姚市| 霞浦县| 龙州县| 侯马市| 忻州市| 玉环县| 化州市| 靖远县| 临安市| 县级市| 唐海县| 福贡县| 离岛区| 青神县| 休宁县| 科技| 榕江县| 唐河县| 建宁县| 喀喇| 永仁县| 剑阁县| 内乡县| 华阴市| 肇源县| 江门市| 仁布县| 常山县| 旺苍县| 连州市| 镇巴县| 玉门市| 都江堰市| 潞西市| 西乡县|