I'm creating buttons dynamically from a javascript for loop by adding this code.
var container = document.getElementById('myList');
var new_element = document.createElement('li');
new_element.innerHTML = '<button type="button" id="">label</button>';
I need to add elements from an array to both the buttons id and label. Like this for example;
arrMarkers[i].title
How can I enclose these array values in the string that creates the button?
'<button type="button" id="'+arrMarkers[i].title+'">label</button>';