How can I get the name of a variable?
Let's say I have an empty variable:
var myvariable;
How can I get the variable name so that this:
alert(this_is_what_i_am_looking_for);
will display:
myvariable
EDIT:
Maybe I am overcomplicating things. My real problem is that I have this two variables:
var firstVariable;
var secondVariable;
And I want to create a third variable that literally has this name:
var firstVariablesecondVariable;
EDIT2:
Thank for the answers, too much information, I have to look at them thoroughly.
This is what I have:
<div></div>
<div></div>
<div></div>
var i = 0;
var q = 0;
$('div').each(function() {
var qi;
i++;
});
So I want to create three varaibles: var 00;var 01;var 02; Then I will load more divs with ajax and do:
q++;
i=0;
so when I apply the each function the second time I have three more variables: var 10;var 11;var 12;