Appending child | Sololearn: Learn to code for FREE!


Appending child

Why can't I append "line" to "svg"?

10/6/2017 2:34:31 PM


4 Answers

New Answer


To manipulate SVG commands on JavaScript, one must use the svg <script> element


svg uses a namespace. Use document.createElementNS(): I use it in [JS] line 80 here:


Try this instead var line = document.createElementNS("", 'line');


You can! Just that it's an object, thus that display