View Single Post
Old 03-19-2004, 03:32 PM   PM User | #1
mamtakansal
New Coder

 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
mamtakansal is an unknown quantity at this point
How to delete a range of nodes..

Hello,

I am trying to delete a selection of nodes as follows:

Code:
newRange = document.selection.createRange();
newRange.selectNodeContents(document.getElementById("id"));
newRange.deleteContents();
But I get a javascript error on line2:
Object doesn't support this property or method.

Could anyone please tell how do I delete all the children and sub children of a tag in an Html document?

Thanks a lot!

Last edited by liorean; 05-21-2004 at 01:14 PM..
mamtakansal is offline   Reply With Quote