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

which button was pushed

Status
Not open for further replies.

MikePalm

Programmer
Feb 6, 2002
34
US
I have a web page with several buttons. i would like to know in a javascript routine which button was pushed.

Clients use IE

Thanks,

Mike
 
In ie, you can use event.srcElement to get to the element object where the event is triggered. With ff/nn, the equivalent is the event.target object.
- tsuji
 

The answer would depend on what the buttons do. If they submit a form, you could detect this server-side. If they just call stuff on the page, then detection is dead easy (the onclick could set a flag, for one).

Provide some more detail, and a more accurate answer might be forthcoming.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top