I am trying to pass a string in the onClick event handler function\'s arguments of the dynamically created anchor element, see the fiddle http://jsfiddle.net/shmdhussain/bXYe4/.
Directly use:
test('elem[i].url')
instead of:
test('"+elem[i].url+"')
to pass the string inside a method.