HTML Element
This example demonstrates the creation of an HTML element on a web page using vanilla JavaScript. It shows the fundamental pattern of dynamically adding a div to the document body. The code uses the Document Object Model (DOM) API methods `document.getElementsByTagName` to locate the root `<html>` element and `document.createElement` with `appendChild` to insert a new element with the id `dogsb`. A self-contained `elementObject` constructor function encapsulates the logic, and inline CSS styles set the page’s text alignment and font size.