I would like to add a new path-tag inside an exisiting svg-tag with JavaScript. Is there a way I could achieve this?
In my HTML-File I have defined a svg like this:
<svg viewBox="0 0 1240 1454" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- HERE I WOULD LIKE TO ADD A NEW PATH-TAG -->
</svg>
I tried with jQuery to append a path-tag (like for example this one) to the svg. But it did not work.
<path d=" M20.5,1441.5 L19,1441.5 Z " fill="#cdd335" fill-opacity="1" id="shape-1"></path>
Is there a way to include new paths to a svg? Do I need another library?