Correct alternative to eval().

Correct alternative to eval().

Hi, can anyone tell me the correct way to form a string without using the eval() function.

I am currently using the following code:

  1. alert(eval(childID).getAttribute('data-name'));

Thanks,
Lammie.