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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onClick in <a> tag

Status
Not open for further replies.

superfly404

Technical User
Feb 1, 2005
24
US
Will onClick work in an <a> to call a function once the link is clicked?

for example:

<a href="mailto:test@test.com" onclick="emailtrack()">test@test.com</a>
 
Yes, but if you're doing something where you're browsing to a new page, it will often go to the new page before the function completes.

what does emailtrack() do?

*cLFlaVA
----------------------------
[tt]your mom goes to college[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
emailtrack is a script to track the number of clicks made to the mailto tag.

Doesnt the link have to be encapsulated in form code some how though for it to work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top