Please look at the following code -
var abc_text = "Hello"; var def_text = "world"; function testMe(elem) { var xyz = elem+"_text"; alert(xyz); } testMe("abc"); testMe("def");
I am trying to pass a prefix to a function and trying to print some predefined values โโby concatenation. But the above example just prints "abc_text" and "def_text" .. instead of "Hello" and "world". How can I make it work?
Thanks.
EDIT
I am using jQuery.
javascript
TigerTiger
source share