I need to parse a element from a XML file: <a> <b>45</b> <c>67</c> </a> <a> <b>98</b> <c>89</c> </a> So I try to read and put in a html element the first value of b with the next code: document.getElementById("apDiv3").innerHTML=xmlDoc.getElementsByTagName("b")[0].data; or document.getElementById("apDiv3").innerHTML=xmlDoc.getElementsByTagName("b")[0].value; Code (markup): and I get a undefined message.Where is the problem?
Try with this: document.getElementById("apDiv3").innerHTML = xmlDoc.getElementsByTagName("b")[0].firstChild.nodeValue; Code (markup):
yes it works,thanks, but now I have another problem : I have a radiogroup and I want to change a variable in function of what radio button of the radiogroup is selected