From 43278d20b23d86dac9319b023f9e35cea491c64c Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Sat, 6 Jan 2024 22:24:34 +0100 Subject: [PATCH] Added second element (h3), changed way of appending appendChild can only append one element, append on the other hand takes a list of elements --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1e4665d..16d21fa 100644 --- a/index.js +++ b/index.js @@ -10,4 +10,8 @@ const p1 = document.createElement('p'); p1.style.color = "#f00"; p1.textContent = "Hey I'm red!"; -container.appendChild(p1); +const h3 = document.createElement('h3'); +h3.style.color = "#00f"; +h3.textContent = "I'm a blue h3!"; + +container.append(p1, h3);