have a static links which is feeded with data from js function.
<div class="link">
<a id="pdfdocument" class="button" target="_blank" href="#">Download starten</a>
<a id="xlsdocument" class="button" target="_blank" href="#">Download starten</a>
</div>
JS
if (contentElement.name.indexOf(".xls") != -1) {
"<a id='" + $("#xlsdocument").attr("href", "/dcontent?element=" + contentElement.id + "&handle=" + openBi.handle) + "</a>";
$('#pubExcel').html(contentElement.filename);
} else {
$("#pdfdocument").attr("href", "/dcontent?element=" + contentElement.id + "&handle=" + openBi.handle);
$('#pubPdf').html(contentElement.filename);
}
my question is, how to create generic link if i have loaded more than one document. for example 4 documents = 4 links for pdf and 4 excel in html, 40 documents = 40 links for pdf and 40 excel in html.. struggeling on such a easy step
<a id='), add the result of changing the href of #xlsdocument, add another string, and then throw it away."