SVG get text element width

前端 未结 6 1822
误落风尘
误落风尘 2020-12-02 07:40

I\'m working on some ECMAScript/JavaScript for an SVG file and need to get the width and height of a text element so I can resize a re

6条回答
  •  鱼传尺愫
    2020-12-02 08:19

    document.getElementById('yourTextId').getComputedTextLength();
    

    worked for me in

提交回复
热议问题