I'm getting the value of a node by this code in javascript,
function show(){
var x = document.getElementsByTagName("allowance")[0];
var y = x.nodeValue;
alert(y);
}
from this xml in html.
<xml style="display: none">
<students id="lul">
<student>
<name>Mark Fajardo</name>
<allowance>9999</allowance>
</student>
<student>
<name>Rencie Macale</name>
<allowance>20</allowance>
</student>
</students>
</xml>
But the output that alert projects is just null. Help
Also you can use innerHTML like this