Working with SVG polygon elements

前端 未结 4 560
暖寄归人
暖寄归人 2021-02-05 09:39

I\'m trying to work with an SVG polygon and javascript. I create a polygon and set its initial point list like this:

var polygon = document.createElementNS(\'htt         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 09:50

    You need to use setAttributeNS. You'll probably want to cache that namespace in a variable somewhere so you don't have to keep typing it.

提交回复
热议问题