This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting on click function and passing in variable

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing something like this:



The problem is that for every element that gets this on click function id is always the last id of the loop. So no matter what element I click I get an ID of say 1008. How do I get it to use a different id for each function?

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic