Entry tags:
um...
Why isn't this working? All I want to do is have an expanding menu and it's straightforward enough but it keeps saying "Object doesn't support this property or method" when I try to use getElementByID. But I have IE6 and I know it works with the DOM because the same thing works for me on other pages, just not mine.
I got just about the simplest example I could find and it still doesn't work. What's wrong with it?
<html>
<head>
<script language="JavaScript" type="text/javascript">
function ChangeTitle(){
var newtitle = document.form1.newtitle.value;
var changeme = document.getElementByID("head1");
changeme.firstChild.nodeValue = newtitle;
}
</script>
</head>
<body>
<h1 id="head1">Dynamic Heading<
<br>
<form name="form1">
<input type="text" name="newtitle">
<input type="button" value="Change!" onClick="ChangeTitle();">
</form>
</body>
</html>
I got just about the simplest example I could find and it still doesn't work. What's wrong with it?
<html>
<head>
<script language="JavaScript" type="text/javascript">
function ChangeTitle(){
var newtitle = document.form1.newtitle.value;
var changeme = document.getElementByID("head1");
changeme.firstChild.nodeValue = newtitle;
}
</script>
</head>
<body>
<h1 id="head1">Dynamic Heading<
<br>
<form name="form1">
<input type="text" name="newtitle">
<input type="button" value="Change!" onClick="ChangeTitle();">
</form>
</body>
</html>