Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] getElementsByTagName not working ???


  • From: kim.hoogenberg at virgil.nl (Kim Hoogenberg)
  • Subject: [Javascript] getElementsByTagName not working ???
  • Date: Thu Jul 21 07:59:59 2005

where have you included your script?

Kim

> Hi,
>
> 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....
>
> Thanks for any help.
>
> James
>
> 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/";;
>
>
> /////////////////////////
> HTML
>
> <div id="codesection">
> <p id="codepara">
> </p>
> <ul>
> <li><a href="http://www.sitepoint.com/"; id="splink">SitePoint</a></li>
> <li><a href="http://www.yahoo.com/"; id="yalink">Yahoo!</a></li>
> </ul>
> </div>
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript