This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IT2/test-template-generator/resources/js/linkConnector.js
2020-01-30 16:43:35 +01:00

22 lines
642 B
JavaScript

const taskArray = tasks.tasks;
const grid = document.getElementsByClassName("textboxGrid")[0];
for (i=0; i<taskArray.length; i++) {
const linkElement = document.createElement("div");
linkElement.className = "linkElement";
const path = taskArray[i]["path"];
linkElement.addEventListener("click", function () {
window.location.href = path;
} )
const h2 = document.createElement("h2");
const link = document.createElement("a");
link.href = taskArray[i]["path"];
link.innerHTML = taskArray[i]["name"];
h2.appendChild(link);
linkElement.appendChild(h2);
grid.appendChild(linkElement);
}