Reputation: 14250
I want to use dynamic variable for my image.
I have something like
var img = 'test'
var path = "<img src="'../images/' + img + '_default_path.png'"></img>";
but it gave me errors. I know it might be just the quote issue but I am not sure where went wrong. Can someone please help me on this?
Thanks a lot!
Upvotes: 0
Views: 2795
Reputation: 58432
Try this:
var path = '<img src="../images/' + img + '_default_path.png" />';
Upvotes: 5