In a div
element, I have a ContentPlaceHolder
, and inside that is a Linkbutton
.
I am attempting to dynamically remove the link button but encountering the following error:
Error: DOM Exception: NOT_FOUND_ERR (8).
Below is my code snippet:
<div id="leftcol" style="z-index: 0">
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
<asp:LinkButton CssClass="childLI" ID="tblRSManswers" runat="server" Text="RS Manswers" OnClick="ChildLink_Click" >
Javascript code:
var child = document.getElementById("tblRSManswers"));
alert(child);
var parent = document.getElementById("ContentPlaceHolder2"));
alert(parent);
parent.removeChild(child);
P.S: The alerts are not NULL.