Spaces:
Running
Running
Update index.html
Browse files- index.html +14 -1
index.html
CHANGED
@@ -18,7 +18,20 @@
|
|
18 |
|
19 |
while (i < linkz.length) {
|
20 |
console.log(linkz[i]);
|
21 |
-
i++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
document.getElementById("in_html").innerHTML=links
|
23 |
</script>
|
24 |
</body>
|
|
|
18 |
|
19 |
while (i < linkz.length) {
|
20 |
console.log(linkz[i]);
|
21 |
+
i++;
|
22 |
+
// create a new div element
|
23 |
+
const newDiv = document.createElement("div");
|
24 |
+
|
25 |
+
// and give it some content
|
26 |
+
const newContent = document.createTextNode(linkz[i]);
|
27 |
+
|
28 |
+
// add the text node to the newly created div
|
29 |
+
newDiv.appendChild(newContent);
|
30 |
+
|
31 |
+
// add the newly created element and its content into the DOM
|
32 |
+
const currentDiv = document.getElementById("div1");
|
33 |
+
document.body.insertBefore(newDiv, currentDiv);
|
34 |
+
};
|
35 |
document.getElementById("in_html").innerHTML=links
|
36 |
</script>
|
37 |
</body>
|