I have an array of buttons on my web page, and when any one of them is clicked on I need to find out what the array index of that button actually is. So for example, you could have an 'onclick' function in each button so that when you click on it it shows an alert like, 'You clicked on button number 2', etc...
I've tried doing stuff like 'alert(this.id'), but it still doesn't return the index number.
How would I go about doing that?
posted 8 years ago
You could do a loop through the buttons
you would just have to send this to that function.
Eric [ June 01, 2007: Message edited by: Eric Pascarello ]