Jump to content

how to refer to this.id somewhere else


makata
 Share

Recommended Posts

http://jsfiddle.net/tearex/mXQqP/ I have hit the wall on a trivial as i think problem. I can not replicate assignment of a variable in a different place of the code. Here is how the prototype works: first click one of the randomizers. they populate the select menu. then click the button. it makes the choice of the select menu appear on the diagnostic display. so far so good. now, click the select menu and choose something other than what is chosen the button will update, but upon pressing the button, a few lines of code are missing :( Here is how I see the problem. when the choice of the select menu item is randomized, the variable versioneFOR1 is assigned the content of the selected array element this way: versioneFOR1=(mapa1[this.id][droplista]); In the mirror process, when the choice of the array element is done not through randomization but by the user choice of dropdown menu, this.id does not seem to work. the variable needs to be defined otherwise. I feel the answer to this is simple, but I have hit the wall. please help
Link to comment
Share on other sites

In the place of "this" you need to put a reference to the element you're trying to access. Unless I can see some of the code I can't say much more.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...