Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Add Elements</title>
</head>
<body>
<div id="container"></div>
<script>
var newElement = document.createElement('p');
newElement.textContent = 'New Paragraph';
document.getElementById('container').appendChild(newElement);
</script>
</body>
</html>