const parent = document.body;

const card = document.createElement("article");
card.className = "card";

const title = document.createElement("h2");
title.textContent = "New Card";

const text = document.createElement("p");
text.textContent = "Created entirely with document.createElement.";

const button = document.createElement("button");
button.type = "button";
button.textContent = "Click me";

card.append(title, text, button);
parent.appendChild(card);

console.log("Card created with", card.children.length, "children");