um...

Jun. 28th, 2005 09:36 pm
gmonkey42: cartoon Sephiroth (Default)
[personal profile] gmonkey42
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>

January 2020

S M T W T F S
    1234
567891011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 31st, 2026 03:24 am
Powered by Dreamwidth Studios