E
ezmiller
I am trying to learn to write code dynamcially using javascript and the
W3C DOM. Does anybody know why this code mihgt be giving me trouble?
document.getElementsByTagName("head")[0].appendChild(document.createElement("title"));
alert(document.getElementsByTagName("title")[0].tagName);
document.getElementsByTagName("title")[0].appendChild(document.createTextNode("test"));
I get an error on the 3rd line: "Unexpected call to methor or property
access." I can't see why it's unexpected...
W3C DOM. Does anybody know why this code mihgt be giving me trouble?
document.getElementsByTagName("head")[0].appendChild(document.createElement("title"));
alert(document.getElementsByTagName("title")[0].tagName);
document.getElementsByTagName("title")[0].appendChild(document.createTextNode("test"));
I get an error on the 3rd line: "Unexpected call to methor or property
access." I can't see why it's unexpected...