You can copy the d-attribute's value from the path tag. SVG Tutorial SVG Intro SVG in HTML . The following are some of the benefits of using SVG over other image formats (such as JPEG and GIF): Any text editor can be used to generate and edit SVG files. oh yeah, the namespace: gets me every time. So let's try and recreate the element above with Javascript. Now lets add some simple CSS to change the fill color of the .target class. What are you trying to do? Seems like the newly created 'symbol' element isn't getting registered by the SVG object for some reason. Lastly, a place to write some JavaScript. SVG Tutorial - How to Code Images with 7 Examples - freeCodeCamp.org SVG file using HTML <img> element Method 2: Using SVG as an <object> Syntax: <object type="image/svg+xml" data="logo.svg" class="logo"> Logo </object> Embedding a SVG via a <object> element requires: type attribute data attribute class attribute ( if using external/internal CSS ) Pros : You can use external/internal CSS to style SVG. To style the rectangle, you can use the setAttribute() method. Using Kolmogorov complexity to measure difficulty of problems? Why's this not drawing? But the next time you need a simple icon, a diagram, or animation, maybe you can code it yourself. Then set its attributes like (src, height, width, alt, title, etc). Here is what you can do to flag gavinsykes: gavinsykes consistently posts content that violates DEV Community's on CodePen. To be honest, this requires a bit of imagination. so it adds