HTML & Javascript
✓ Published0🌍 Public
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 descriptionMIT Licensed