Hi,
In my javascript book, I have an exercise where I’m supposed to create a document with a couple of elements each of which have id attributes, then retrieve those elements and make changes to them. So, here’s the code I tried to run…Firebug is telling me that “document.getElementbyID is not a function”. What’s wrong?
Thanks,
Jeff
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<title>Create</title>
</head>
<body>
<p id=“para1”>This is paragraph 1 </p>
<p id=“para2”>This is paragraph 2 </p>
<script type = "text/javascript" >
[COLOR="Red"]var e1 = document.getElementByID("para1");[/COLOR]
var e2 = document.getElementByID("para2");
e1.innerHTML = "New para1";
e2.innerHTML = "New para2";
</script>
</body>
</html