File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Setting on click function and passing in variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Setting on click function and passing in variable" Watch "Setting on click function and passing in variable" New topic
Author

Setting on click function and passing in variable

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://www.coderanch.com/t/119917/HTML-JavaScript/Scope-Chain-Closures

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting on click function and passing in variable
 
Similar Threads
problem with clone()
need enclosing form name of a element in jquery
Passing arguments to function passed to event click function.
only works in firefox
Dynamically added form fields cannot access from request access