Hello,
would you explain to me why this JS test in an XML file doesn’t work?
<?xml version="1.0" ?>
<!-- <?xml-stylesheet type="text/css" href="main.css" ?> -->
<root xmlns="http://www.w3.org/1999/xhtml">
<a:musicstore xmlns:a="http://www.w3.org/TR/html4/">
<a:album>
<a:name>Scenes from a Memory</a:name>
<a:artist>Dream Theater</a:artist>
<a:year>1999</a:year>
</a:album>
</a:musicstore>
<b:musicstore xmlns:b="http://www.w3.org/TR/html4/">
<b:album>
<b:name>Protocosmos</b:name>
<b:artist>Allan Holdsworth</b:artist>
<b:year>2001</b:year>
</b:album>
</b:musicstore>
<script type="text/javascript">
<![CDATA[
document.getElementsbyTagName("year").innerHTML = "2000";
]]>
</script>
</root>
It is returning me this:
TypeError: undefined is not a function (evaluating 'document.getElementsbyTagName("year")')
Thank you!