Can I move an SVG element between SVG groups - without stirring too much calculation behind the scenes nor crafting too much code in my own code? The d3 api documentation me
Perhaps you could do this, with multiple elements:
d3.select('#btn').on('click', function() { circle.remove() .each(function(){ group2.node().appendChild(d3.select(this).node()); }); });
jsFiddle