I'd like to use a JQuery selector to return a variable by passing a text string of the variable name:
ex.
var test = "xxx";
I'm thinking I could do something like this, but it won't work:
alert($("#test"));
Edit: People are getting confused. Think of it as a reflective way to get the contents of var test. Preferrably with a JQuery selector, but I'll take any way one can come up with it..
alert(test)won't work because...?test. Am I correct?