You can use an eval
to do it, though I try to avoid that sort of thing at all costs.
alert(eval(someString));
A better way, if you find yourself needing to do this, is to use a hash table.
var stuff = { myText: 'hello world!' };
var someString = 'myText';
alert( stuff[someString] );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…