score:0

Accepted answer

You need to create the svg element with svg namespace uri for it to support path when creating directly with JavaScript:

  var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');

Instead of just the typical

var svg = document.createElement('svg');

Alternatively, you could use D3 to append the svg, which will make sure it's correctly namespaced!

  d3.select(child).append('svg').attr('id', 'donut');

More Query from same tag