var myArray = ["id1", "id2", "id3"];
var container = document.getElementById('container');
myArray.forEach(function(id){
container.innerHTML = container.innerHTML + "<a href=\""+id+"\">"+id+"</a>"
});
solved Simple JavaScript append array link ids to html doc? [closed]