<button id="btn"></button><script>
btn.removeNode();
</script>

解决方案 »

  1.   

    <body>
    <input type="text" id="txtName" />
    <button onclick="del()">删除</button>
    <button onclick="alert(document.body.innerHTML);">查看</button>
    <script>
    function del(){
    txtName.removeNode();
    }
    </script>
    </body>
      

  2.   

    表格相关http://dev.csdn.net/article/35/35257.shtm
      

  3.   

    <script>
    function s1()
    {
      document.getElementsByName('txt')[0].removeNode(true);
    }
    function s2()
    {
      document.getElementsByTagName('table')[0].rows[0].removeNode(true);
    }
    </script>
    <body>
    <input type=text name="txt"><br>
    <table>
    <tr><td><input type=button value=button></td></tr>
    </table>
    <input type=button value=删除文本框 onclick="s1()">
    <input type=button value=删除表格行 onclick="s2()">
    </body>