Setting Titles using element ID for multiple symbols

I hope someone can help, I am trying to automate adding several symbols and their respective content via the follwoing, however this works for one symbol but when I have several of these symbols it uses the last to update, is there a way I use ‘this’ for this purpose?

MultipleLocationTest.zip (20.8 KB)

I would use an underscoreseparator for the symbol-ids and do sthg like this onsymbolload:

var locations = element.id.split('_');
element.getElementsByClassName('locationCountry')[0].textContent = locations[0];
element.getElementsByClassName('locationCity')[0].textContent = locations[1];	

MultipleLocationTest.hype.zip (332.9 KB)

4 Likes

brilliant thank you Hans.