> Javascript: > var myDiv=secondtdArray.item(0).firstChild.data; > firsttdArray=xmlRoot.getElementsByTagName("second"); > document.getElementById("myDiv").innerHTML =firsttdArray.item > (0).firstChild.data; > > I tired to secondtdArray.item(0).firstChild.data directly in place of > myDiv in document.getElementById...................The error show is > > document.getElementById("secondtdArray.item(0).firstChild.data") is > null > > When i used a specified address the functionalityis geting fine
Remove the quotes in your calls to getDocumentById. document.getElementById(second) or document.getElementById(secondtdArray.item(0).firstChild.data)