0

I need to create a JavaScript Framework to build a FlowChart inside the browser. To manipulate the DOM I use mostly follow function insertAdjacentHTML.

Now I try my current implementation in different browser and I had to realize, that the Internet Explorer 11 can't use the insertAdjacentHTML function inside a SVGElement.

So I tried to add the new Elements on another ways.

  • innerHTML (+=)
  • appendChild

But nothing of them is in a SVGElement supported. I have to add new elements inside my existing SVGElement (like a rectangle). Does anyone have an idear how to relize that for the Internet Explorer 11?

Nyxero
  • 69
  • 1
  • 11

1 Answers1

0

Im sorry, I overlooked a old post with the same question: Creating SVG elements dynamically with javascript inside HTML

var svgNS = "http://www.w3.org/2000/svg";
var rect = document.createElementNS(svgNS, "rect")
rect.setAttribute("fill", "black")

That are the magic words!

Nyxero
  • 69
  • 1
  • 11