I have this script taken from w3schools. But when i run it locally I get an error on line 9 - Object Required. What am I doing wrong?
<html>
<head>
<script type="text/javascript" for="window" event="onload">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM"
xmlDoc.async="false"
xmlDoc.load("note.xml"
'line 9
nodes=xmlDoc.documentElement.childNodes
a1.innerText=nodes.item(0).text
a2.innerText=nodes.item(1).text
a3.innerText=nodes.item(2).text
a4.innerText=nodes.item(3).text
</script>
</head>
<body bgcolor="yellow">
<h1>W3Schools Internal Note</h1>
<b>To:</b>
<span id="a1"></span>
<br />
<b>From:</b>
<span id="a2"></span>
<hr />
<b><span id="a3"></span></b>
<hr />
<span id="a4"></span>
</body>
</html>
<html>
<head>
<script type="text/javascript" for="window" event="onload">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM"
xmlDoc.async="false"
xmlDoc.load("note.xml"
'line 9
nodes=xmlDoc.documentElement.childNodes
a1.innerText=nodes.item(0).text
a2.innerText=nodes.item(1).text
a3.innerText=nodes.item(2).text
a4.innerText=nodes.item(3).text
</script>
</head>
<body bgcolor="yellow">
<h1>W3Schools Internal Note</h1>
<b>To:</b>
<span id="a1"></span>
<br />
<b>From:</b>
<span id="a2"></span>
<hr />
<b><span id="a3"></span></b>
<hr />
<span id="a4"></span>
</body>
</html>