动态添加td输入框

动态添加td输入框
function addRow() { 
        var tab=document.getElementById("tab");
        var n=document.getElementById("x").rowIndex+1;
        var tr=tab.insertRow(n);
        var td=tr.insertCell(0);                                                                                                                                                                                                                                                                     
        tr.innerHTML="<td class="table_body" align="right">日志内容</td><td class="table_none" colspan="3"><input name="syslogcontentcontent" type="text" ;
    }
动态添加td输入框
function deleteRow(obj) {
        $(obj).parent().parent().remove();
    }

动态在div中添加input框

1
2
3
4
5
6
7
8
function  hh(){
          $("#zw1").append('<span >);
          InputCount++;
     }
          function  hh1(){
              $("#zw2").append('<span >);
              InputCount++;
       }

  

1
2
3
4
5
<div id="zw1" style="margin-bottom : 60px; margin-top:10px;" >
                           <li class="horizontal_onlyRight" style="margin-top:10px;">
                           <input name="zw11" class="text_input100" id="zw11" onkeyup="tihuan(this)" value="">     
                           </li>
                         </div>

1、innerHTML写入html代码方法,是原生态JS方法:
<div );
</script>

动态添加td输入框
function addRow() { 
        var tab=document.getElementById("tab");
        var n=document.getElementById("x").rowIndex+1;
        var tr=tab.insertRow(n);
        var td=tr.insertCell(0);                                                                                                                                                                                                                                                                     
        tr.innerHTML="<td class="table_body" align="right">日志内容</td><td class="table_none" colspan="3"><input name="syslogcontentcontent" type="text" ;
    }
动态添加td输入框
function deleteRow(obj) {
        $(obj).parent().parent().remove();
    }

动态在div中添加input框

1
2
3
4
5
6
7
8
function  hh(){
          $("#zw1").append('<span >);
          InputCount++;
     }
          function  hh1(){
              $("#zw2").append('<span >);
              InputCount++;
       }

  

1
2
3
4
5
<div id="zw1" style="margin-bottom : 60px; margin-top:10px;" >
                           <li class="horizontal_onlyRight" style="margin-top:10px;">
                           <input name="zw11" class="text_input100" id="zw11" onkeyup="tihuan(this)" value="">     
                           </li>
                         </div>

1、innerHTML写入html代码方法,是原生态JS方法:
<div );
</script>