> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/browser/svg/namespace.md).

# namespace

**SVG** and **HTML** have **different namespaces**. When HTML is read and parsed by the browser and it finds an **`<svg>`** tag, it automatically applies the correct namespace.&#x20;

But if you just append an **`<svg>`** tag into the DOM yourself, that SVG **won’t** have the correct namespace by default, and thus it **won’t** behave like an SVG element.

To create a new SVG element in JavaScript with the proper namespace, you need to do something like this:

```javascript
var svgElement = document.createElementNS("www.w3.org/2000/svg", "svg"); 
```

That goes for the SVG element and any child SVG element you append.
