Adding elements

const newElement = document.createElement("h2");
newElement.textContent = "Some created title";

const parentElement = document.querySelector("body");
parentElement.appendChild(newElement);

for(let k=0; k<10; k++) {
  const paragraphElement = document.createElement("p");
  paragraphElement.textContent = "Paragraph "+k;
  document.querySelector("body").appendChild(paragraphElement);
}