I have xml as follows:
<a>
<a>
<d>0</d>
</a>
<a>
<d>99</d>
</a>
</a>
This is my code javascript.
var a = document.getElementsByTagName("a");
var d = a[1].getElementsByTagName("d")[0].firstChild.data;
document.write("d = " + d);
The result is d = 0
but my expected result is d = 99
.
Could you help me please?
I want to input only index 1 (a[1])
i do not want to input index 2.