From 8a81d9198fd07343a55065666748c71c11c99877 Mon Sep 17 00:00:00 2001 From: nayakrujul Date: Fri, 3 Nov 2023 08:16:48 +0000 Subject: [PATCH] Subject folders --- index.html | 64 ++++++++++++++++++++++++++++-------------------------- load.js | 24 +++++++++++++------- 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/index.html b/index.html index 918d9de..006c002 100644 --- a/index.html +++ b/index.html @@ -10,41 +10,43 @@

VTP6

- - © Rujul Nayak 2023 - Feedback + © Rujul Nayak 2023 - Feedback \ No newline at end of file diff --git a/load.js b/load.js index d9ac681..334e89e 100644 --- a/load.js +++ b/load.js @@ -1,13 +1,21 @@ // Load the links onto the main page -const ll = document.getElementById("linklist"); +const sub = document.getElementById("sub"); -LIST_OF_LINKS.forEach(s => { - if (s === "") { - ll.appendChild(document.createElement("br")); - } else { +LIST_OF_LINKS.forEach(p => { + let [a, b] = p; + let det = document.createElement("details"); + let sum = document.createElement("summary"); + sum.innerHTML = a; + det.appendChild(sum); + let ul = document.createElement("ul"); + b.forEach(s => { let newli = document.createElement("li"); - newli.innerHTML = `` + s + ``; - ll.appendChild(newli); - } + newli.innerHTML = `` + s + ``; + ul.appendChild(newli); + }); + det.appendChild(ul); + document.body.insertBefore(det, sub); + document.body.insertBefore(document.createElement("br"), sub); + document.body.insertBefore(document.createElement("br"), sub); }); \ No newline at end of file