After successfully loading and appending multiple SVGs to a DOM element, I encountered an issue when trying to do the same with only one SVG file. When attempting to extract nodes using:
let myElement = fragment.select( '#elementID' );
container.appendChild( myElement.node.cloneNode(true) );
It became apparent that this method did not work as expected. The reason being that myElement
was recognized as an element rather than a fragment. As a result, myElement.node
displayed a tag not encompassed by an SVG element.
The challenge at hand is how to encapsulate an SVG element around myElement
in order to append it to another DOM element?