<div></div>
// Create new element
const newParagraph = document.createElement('p');

// Add text content to new element
newParagraph.textContent = 'Test paragraph';

// Select parent element
const parentDiv = document.querySelector('div');

// Append new element to parent element
parentDiv.appendChild(newParagraph);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.