I'm sure there is a simple answer to this but I couldn't find it.
I know how to concatenate a normal string in JavaScript but how would I do it within an object?
I require this as I'm reading through an XML file and creating the HTML for a list of links. Each time I go through the loop I want to create a new <li>
containing the link. How do I get the current value of the string and then append the new link on the end? Once I've read through the XML I'll append the HTML to the page.
I've tried:
carParks.links = carParks.links + "<li><a href=\"#\">car park</a></li>";
with no success.
Any help is much appreciated.