How to know which Hyper Link is clicked?

Hi

How to know which Hyper Link is clicked among multiple Hyper Links.

I am creating a Web Page in which I have multiple hyper links and each of them calls a method "Display()" when it gains Focus. In which, I have to get the Anchor Id of the clicked link.

How to know which hyper link is clicked?

[323 byte] By [Vencya] at [2007-11-27 3:58:06]
# 1
You can give the styleIds to each and every h-links and get that id using script It's simple yaaar............Regard'sRaj'Ka'ht
rajnikanthgoldstonea at 2007-7-12 9:02:30 > top of Java-index,Java Essentials,Java Programming...
# 2
I have given the id's to them.But my problem is how to get the id of a Clicked one.Could you please give me a logic interms of code.Thank You
Vencya at 2007-7-12 9:02:30 > top of Java-index,Java Essentials,Java Programming...
# 3
> > Could you please give me a logic interms of code.> document.getElementById('h-link Id')
rajnikanthgoldstonea at 2007-7-12 9:02:30 > top of Java-index,Java Essentials,Java Programming...
# 4
document.getElementById('h-link Id')It will returns HREF not ID.How can I specify the H-link ID, when I have to get that...
Vencya at 2007-7-12 9:02:30 > top of Java-index,Java Essentials,Java Programming...
# 5
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhh.............using that you can find the href .........thn your problem is solved ...........you want to know which link he is going to click am i right if yes my ans is [b]right[/b]........................
rajnikanthgoldstonea at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 6
NO....I want ID of the link being clicked.. My further coding requires it.
Vencya at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 7
Using that id what you will do ?
rajnikanthgoldstonea at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 8

I am creating a JSP. In which, all Hyper-links goes to another JSP. I have to get the Anchor Text so that I can retrieve values from the database.

In order to get that Anchor Text, I want Anchor object ID.

document.form.cname.value = anc_id.innerText;

Using this I can get the Anchor Text.. So I want Id of the Link being clicked.

If u have any Idea other than this.. U can suggest...

Thank You

Vencya at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 9
Where is the Java part of the question?
CeciNEstPasUnProgrammeura at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 10
You can pass "this" to the function handling the event.
BIJ001a at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 11
> Where is the Java part of the question?Java is only part of the question! The other part is script...
BIJ001a at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...
# 12
Of Course It is not (completely) related to JAVA. But I am designing a JSP (which can be used along with HTML). In order to get the required functionality of JSP I require this....
Vencya at 2007-7-12 9:02:31 > top of Java-index,Java Essentials,Java Programming...