Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anchor through function?

Status
Not open for further replies.

Dawg06

Programmer
Jul 24, 2006
13
0
0
CA
Is it possible to call an anchor tag through a function? If so does anyone have an example of how I would do this?

Thanks!
 
If you mean "can I simulate clicking on an anchor to visit the page stored in its href attribute", then the answer is "yes":

Code:
<a id="wibble" href="someurl">...

location = document.getElementById('wibble').href;

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks Dan! Worked great, sorry for the delay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top