<svg xmlns="http://www.w3.org/2000/svg">
<!-- more tags here -->
</svg>Namespaces crash course / notebook
Namespaces crash course
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
document.createElementNS("http://www.w3.org/2000/svg", "rect");rect.getAttributeNS(null, "x");elt.getAttributeNS("http://www.w3.org/1999/xlink", "href");elt.setAttributeNS(
"http://www.w3.org/1999/xlink",
"xlink:href",
"other-doc.svg",
);const SVG_NS = "http://www.w3.org/2000/svg";
const XLINK_NS = "http://www.w3.org/1999/xlink";
const image = document.createElementNS(SVG_NS, "image");
image.setAttributeNS(null, "width", "100");
image.setAttributeNS(null, "height", "100");
image.setAttributeNS(XLINK_NS, "xlink:href", "flower.png");