I don't have an option to remove it from the textarea at the moment. Is there a better way to storing and generating xml data on the fly?
On Jun 23, 8:41 am, Liam Potter <radioactiv...@gmail.com> wrote: > take it out of the textarea, right now it's not XML data but random text. > > bigb wrote: > > I'm having some real difficulty figuring out how to manipulate xml > > data with jquery. Here is my situation. I have a hidden TextArea that > > contains xml data, something like this: > > > <items> > > <item value='1' text='x'></item> > > <item value='2' text='y'></item> > > </items> > > > So, let's say I want to remove the item with value='1'. > > > 1) I grab the value of the textarea: > > > var xml = $("#" + id).val(); > > > 2) I then find the node and remove it: > > > $(xml).find("item[value='123']").remove(); > > > Problem is, it doesn't remove anything! It finds the node just fine, > > but the remove() function doesn't seem like it is doing anything. I've > > tried looping through eacy item $('item',xml).each(function.... ); and > > then calling remove(); but that does not work either. Any help on how > > to manipulate xml data correctly? Thank you. > > > Bryan