SVG Text element not being added in IE

I am trying to add html content to svg text element. It works in chrome but not IE11 .. can anyone help me ... its very simple code.

<svg width="400" height="110">
<g id="test">
    <rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)"/>
    <text id="svgtext" x="0" y="15" fill="red"></text>
    </g>  

      

JQuery code

 $("#svgtext").html("&#10006")

      

here is the fiddle link http://jsfiddle.net/6nz0recd/

check IE, it doesn't work

+3


source to share


1 answer


IE doesn't support the jquery html method for SVG objects. However, you can use the text method.



$("#svgtext").text("\u2716")

      

+2


source







All Articles