K
Konrad Mathieu
How do I - within in a function - make Javascript recognize a string as a
variable name?
Thanks and cheers,
Konrad
variable name?
Thanks and cheers,
Konrad
How do I - within in a function - make Javascript recognize a string as a
variable name?
HikksNotAtHome said:"Konrad Mathieu" said:How do I - within in a function - make Javascript recognize a string as a
variable name?
Thanks and cheers,
Konrad
How you do that depends on what the string's variable representation
represents.
For the most part, you simply use bracket notation.
If the string points at a variable, window['StringHere'] will give you a
reference to global variables (there are some cavaets to it I believe).
If its a name of a form element:
document.forms[varName].elements[varName2].propertyName
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.