How to remove an svg container and put its content onto a group( id= g8 for instance)?
var content1 = select('svg1').removeChild('all');
content1.addto('g8);
I need to remove the svg container:
<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" viewBox="0 0 481.89 368.504"> </svg>
And put everything :
<g id = 'g8'> svg content goes here...</g>
Edit: How can I fix this code to load only the innerSVG code of the svg file into an svg group named svg1?
Snap.load( "bike2.svg", function( f ) {
g1 = f.select("innerSVG"); // I want to select the svg content only.
s.append(g1);
g1.attr({id: 'g1' });
Edit: this code works when I select a g from that svg:
g1 = f.select("#g4");
// but I want all the content of the svg like all the elements and
groups without its container.