🌍 Public
Viewing a saved revision (read-only)
96b54ee42fe24ed983d9c6c9425e09e4
HTML & Javascript
This example demonstrates how JavaScript can dynamically generate HTML headings. It creates a div container and uses a for loop to create three heading elements with the text "Heading 1," "Heading 2," and "Heading 3." The script uses the Document Object Model (DOM) methods `document.createElement` and `container.appendChild` to build the content. The page sets a large font size of 36 pixels via inline CSS, but the rendering depends entirely on the browser's default styling for heading elements.
AI-generated description