From ae2b9e79468b4df18ec38ff8c306b9eb5fea00b7 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Sat, 6 Jan 2024 22:25:46 +0100 Subject: [PATCH] Added third element (div) with children (h1, p) --- index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 16d21fa..ae5f5d6 100644 --- a/index.js +++ b/index.js @@ -14,4 +14,15 @@ const h3 = document.createElement('h3'); h3.style.color = "#00f"; h3.textContent = "I'm a blue h3!"; -container.append(p1, h3); +const div = document.createElement('div'); +div.style.cssText = "border: 2px solid #000; background: pink;"; + +const h1 = document.createElement('h1'); +h1.textContent = "I'm in a div!"; + +const p2 = document.createElement('p'); +p2.textContent = "ME TOO!"; + +div.append(h1, p2); + +container.append(p1, h3, div);