To create dynamic variables in JavaScript use the eval() function. Of course eval() can be for other dynamic JavaScript creation as well.
function dynamic(id)
{
// Create dynamic variable and set the value
eval("var test_" + id + " = \"value goes here\";");
// Return the value
return eval("test_" + id);
}
// Call function
var test = dynamic(123);
// Display the value
document.write(test);
Demo
View a demo here
Related Posts
Tags: dynamic variable, jQuery






















You do not need any skills and more necessary rohan crone for a regular attack, but it still looks like you are using a skill.