Feb 15, 2008 #1 focusdev Programmer May 9, 2007 18 US I need to change an attribute located in my xml using javascript but can not seem to find how to do it. Code: <html> ... <xml id=daxml> <group> <item> <desc listing='123'> </item> </group> </xml> In the above sample, I need to change listing to 234. Any ideas?
I need to change an attribute located in my xml using javascript but can not seem to find how to do it. Code: <html> ... <xml id=daxml> <group> <item> <desc listing='123'> </item> </group> </xml> In the above sample, I need to change listing to 234. Any ideas?
Feb 15, 2008 Thread starter #2 focusdev Programmer May 9, 2007 18 US Nevermind, I think I figured it out. Code: var myXML = document.getElementById('daxml'); var desc = myXML.selectSingleNode("//group/item/desc"); desc.setAttribute('listing','234'); Upvote 0 Downvote
Nevermind, I think I figured it out. Code: var myXML = document.getElementById('daxml'); var desc = myXML.selectSingleNode("//group/item/desc"); desc.setAttribute('listing','234');