Updating SVG text using jQuery in IE9-11

前端 未结 1 868
野性不改
野性不改 2021-01-15 17:13

I\'m trying to update the text on a SVG path using jQuery. It works fine in Firefox and Chrome, but in IE9 and IE11 (haven\'t tested on 10, but it\'s probably the same) the

1条回答
  •  囚心锁ツ
    2021-01-15 17:33

    I figured it out:

    It's correct to use the textContent property instead of updating innerHTML, so the line:

    $('#ribbonLeftText').html('bla bla bla');
    

    becomes:

    $('#ribbonLeftText').prop('textContent','bla bla bla');
    

    And it works in all browsers.

    0 讨论(0)
提交回复
热议问题