156Re: Be careful when making functions in a loop...
- Aug 13, 2008--- In email@example.com, "Ben Collver" <tylx@...> wrote:
> I wrote an example script and it appears to bind to the current valueCreate a page with three buttons, a, b, and c. When you click on a
> of the variable "i". The script is at the following URL.
> If you please would you show an example of the problem?
button, it alerts its number. Modify your loop to get each element by
id and attach an onclick handler that alerts the index. If you do it
incorrectly, they will all alert the same wrong number.
- << Previous post in topic Next post in topic >>