Closed Bug 179019 Opened 22 years ago Closed 22 years ago

document.getElementByID "IS NOT A FUNCTION" error.

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Linux
defect
Not set
major

Tracking

()

VERIFIED INVALID

People

(Reporter: shobbie, Assigned: jst)

Details

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
   #container1 { position: absolute; top: 2in; left: 2in; width: 2in; }
   #container2 { position: absolute; top: 2in; left: 2in; width: 2in;
        visibility: hidden;}
-->
</STYLE>

<script language="javascript">

function flip(x, y) {
   alert('hiding:' +x);
   document.getElementByID(x).style.visibility ="HIDE";
   alert('showing:' +y);
   document.getElementByID(y).style.visibility ="SHOW";
   return;
}

</SCRIPT>

</HEAD>
<BODY>
<P>Choose a suspect:</P>
<DIV id="container1">
   <IMG alt="Al Capone" 
        width="100" height="100" 
        src="suspect1.jpg">
   <P>Name: Al Capone</P>
   <P>Residence: Chicago</P>
</DIV>

<DIV id="container2">
   <IMG alt="Lucky Luciano" 
        width="100" height="100" 
        src="suspect2.jpg">
   <P>Name: Lucky Luciano</P>
   <P>Residence: New York</P>
</DIV>

<FORM method="post">
   <P>
   <INPUT name="Capone" type="button" 
          value="Capone" 
          onclick='flip("container2", "container1");'>
   <INPUT name="Luciano" type="button" 
          value="Luciano" 
          onclick='flip("container1", "container2");'>
</FORM>
</BODY>
</HTML>
s/getElementByID/getElementById/
Javascript is case-sensitive.
s/HIDE/hidden/
s/SHOW/visible/

marking invalid - this is not a Mozilla bug
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
I stand corrected.  Much thanks to Andrew Schultz for pointing out my typo.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.