[thelist] (JS) getElementById

Stephen Caudill SCaudill at municode.com
Mon Jul 7 15:31:57 CDT 2003


Scott, Josh,
  You're correct!  thanks to you guys, it's working now.
-Stephen

Scott Brady<mailto:evolt at scottbrady.net> on Monday, July 07, 2003 4:20 PM, said:

> ---------- Original Message ----------------------------------
> From: "Stephen Caudill" <SCaudill at municode.com>
>>  Can someone tell me why this:
>> 
>> document.getElementById("contact").style.color = '#ffcc00';
>> 
>> is not working?  if you'd like to see the page it's in:
> 
> 
> In your source code, you're calling "getElementById" at the
> top of the page, before the page has been constructed.
> 
> What that means is that your element "contact" doesn't exist yet.
> 
> You need to either call that script as an onload or put it at
> the bottom of the page.  I don't know if putting scripts at
> the bottom validates or not, so I'd do the onload option.
> 
> Scott
> ---------------------------
> Scott Brady
> http://www.scottbrady.net/
> 
> 
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> Evolt.org conference in London, July 25-27 2003.  Register today at
> http://evolt.org.uk 
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org Workers of the
> Web, evolt ! 


More information about the thelist mailing list