I've got some XML (valid XHTML) that looks like this:
<html>
<head>
<script type="text/javascript"><![CDATA[
function change_header()
{
document.getElementById("myHeader").innerHTML="Nice day!";
}
]]></script>
</head>
<body>
<h1 id="myHeader">Hello World!</h1>
<button onclick="change_header()">Change text</button>
</body>
</html>
And I'm trying to get the #myHeader
node using docment.GetElementById("myHeader")
but it always returns null
. Why?
I'm guessing it doesn't recognize the id
attribute as the id attribute without a Dtd or something? If that's the case, how can I get it to use an Html Dtd?