+ 3
Svg line pls help set attribute
IHelp me make polyline at svg please. I try to set points of polyline but el.style.points="0 0 9 9" doesn't work How to make with no el.setAttribute() https://code.sololearn.com/WMRXG0zXdyps/?ref=app
2 Réponses
+ 2
Hi Ashas Yiksvorogom , if you use: console.log(JSON.stringify(el.style))
You will see that this style object don't have the "points" property. That why you can not set the ponits using "el.style".
The question is why you don't want to use the setAttribute() method for this?!
According to: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/points
points is an "Attribute", so obviously you need to use setAttribute() to set it!
0
Thank