document.getElementById("row_product[i]").removeChild(this)

解决方案 »

  1.   

    语法有错误
    更改为下形式document.getElementById("row_product["+i+"]").style.display = "none" 
      

  2.   


    <table id="table1"  border="1">
    <tr style="display:none"><td><input></td><td><input type="button" value="删除" onclick="this.parentNode.parentNode.removeNode(true)">
    </tr>
    <tr><td><input></td><td><input type="button" value="删除" onclick="this.parentNode.parentNode.removeNode(true)">
    </tr>
    <tr><td><input></td><td><input type="button" value="删除" onclick="this.parentNode.parentNode.removeNode(true)">
    </tr>
    </table>
    <input name="aaa" type="button" value="新增" onclick=addRow()>
    <script language=javascript>
    function addRow(){
    var objTbody=document.getElementById("table1").childNodes[0]
    var objNewTr=objTbody.childNodes[0].cloneNode(true)
    objNewTr.style.display=""
    objTbody.appendChild(objNewTr)
    }
    </script>
      

  3.   

    楼上,说清楚了。飘过给JQUERY 解决方案 function del(obj,deltag)
    {
     $("#"+obj).parents(deltag).remove();
    }