Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] getElementsByTagName not working ???
- From: hassan at webtuitive.com (Hassan Schroeder)
- Subject: [Javascript] getElementsByTagName not working ???
- Date: Thu Jul 21 07:52:45 2005
James wrote:
> this code doesn't work but I can't figure out what is wrong with it, it
> should be very simple, there are only 3 lines of script....
> var all_links = document.getElementsByTagName('a');
> var sitepoint_link = all_links[0];
>
> // using our sitepoint_link variable from above
> sitepoint_link.href = "http://www.google.com/";
Are you calling this *after* the page loads? Or at least after that
link exists? :-)
--
Hassan Schroeder ----------------------------- hassan@xxxxxxxxxxxxxx
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
- References:
- Prev by Date: [Javascript] getElementsByTagName not working ???
- Next by Date: [Javascript] getElementsByTagName not working ???
- Previous by thread: [Javascript] getElementsByTagName not working ???
- Next by thread: [Javascript] getElementsByTagName not working ???
- Index(es):