🌍 Public
Viewing a saved revision (read-only)
da3c9c8cc4a342d0b3edb7e8ec44b433
SVG fundamentals, baby
This example demonstrates the foundational steps of creating and styling SVG elements using plain JavaScript. It creates an SVG container that fills the entire browser window using the `document.createElementNS` API with the SVG namespace. The code then appends a rectangle with a fixed width of 100 pixels and height of 50 pixels, filling it with black via the `setAttribute` method. The example relies entirely on native browser APIs—no external libraries such as D3 or React—though the metadata notes the framework as React, which is not used in the visible code.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.