faqts : Computers : Programming : Languages : JavaScript : Forms : Buttons

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

30 of 48 people (63%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

how can i find out that which button was clicked on the same document

Jul 12th, 2001 02:09
Jean-Bernard Valentaten, molly .,


Basically you just want to know which button was clicked on. Well this 
is pretty easy. Simply create a variable that the button can be written 
to and initialize it with null, e.g.
var whichButton = null;
Then you simply include some little code to the onClick-Handler of each 
Button
onClick="whichButton = this; //now some action"
That's basically it.
HTH