Removing a DOM node
Posted: Wed Jan 03, 2007 5:44 am
feyd | Please use
I can successfully extract the checkbox and the text, but then cant figure out how to isolate the checkbox as it doesnt seem to be a node.
Any ideas on how to just get the text value?
Thanks in advance.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey folks,
Having an issue with trying to remove a node from the DOM inorder to be left with just plain text. The HTML is as follows:
[syntax="html"]
<li id="listitem"><a href="#abc" id="link"><input type="checkbox" id="cb" /> text here</a></li>
Code: Select all
nodeToRemove = document.getElementById("listitem");
val = nodeToRemove.firstChild.innerHTML;
window.alert(val);
Thanks in advance.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]