1

The following code gives a nice editable svg text box (in Chrome at least):

d3.select("body").append("text").text("Test").attr("contentEditable","true");

However, the following code does not work:

d3.select("svg").append("text").text("Test").attr("contentEditable","true");

Is there any way to make svg text editable along the lines of the second snippet above? I'm really hoping to avoid foreignObject if possible.

Eric
  • 31
  • 7
  • The first is not an SVG text box. SVG doesn't provide interactive elements in the same way as HTML does. You'll have to use `foreignObject` for that. – Lars Kotthoff Nov 21 '14 at 19:22

0 Answers0