• 动态新增文本框


    <html>
       <head>
         <meta http-equiv="Content-Type" content="text/html; charset=GB2312">
         <script>
           var count = 0;
          
           function addByScript() {
             var table = document.getElementById("tbl1");
             var newRow = table.insertRow(table.rows.length);
             newRow.id = "row" + count;
            
             var contentCell = newRow.insertCell(-1);
             contentCell.innerHTML = '<input type="text" />';
             contentCell = newRow.insertCell(-1);
            
             var delBtn = document.createElement("input");
             delBtn.type = "button";
             delBtn.className = "button";
             delBtn.id = "btnDel"+count;
             delBtn.value = "删除";
             delBtn.onclick = new Function("del(this)");
             contentCell.appendChild(delBtn);
                    
             count++;
           }
          
           function del(obj) {
             var row = obj.parentNode.parentNode;
             row.parentNode.removeChild(row);
           }     
         </script>
       </head>
       <body>
         <fieldset>
     <legend>
             insertRow新增
    </legend>
           <input type="button" class="button" value="新增" onclick="addByScript()"/>
           <table id="tbl1">
           </table>
         </fieldset>
       </body>
     </html>

  • 相关阅读:
    route命令
    linux下限制ip访问
    linux安装oracle客户端
    Upgrading to Kentico 12
    online youtube subtitle downloader
    Driving continuous quality of your code with SonarCloud
    炉石传说 乱斗模式 三足鼎立
    Behavior-driven development
    TestNG like unit testing framework in C# (C sharp)
    Windows 10 & 8: Install Active Directory Users and Computers
  • 原文地址:https://www.cnblogs.com/howie/p/3025460.html
Copyright © 2020-2023  润新知