You are here: irt.org | FAQ | JavaScript | Link | Q670 [ previous next ]
The links object array is very limited. All you can do is loop around the array comparing the href property of the link clicked:
<SCRIPT LANGUAGE="JavaScript"><!-- function checkWhichOne(url) { for (var i=0; i < document.links.length; i++) if (('http://somewhere.com/' + url) == document.links[i].href) alert('Link number ' + i + ' was clicked.'); //--></SCRIPT> <A HREF="somepage.htm" onClick="checkWhichOne(this.href)">....</A>