使用折线点设置属性

set attribute with polyline points

本文关键字:设置 属性 折线      更新时间:2023-09-26

我知道以下代码将以这种特定方式设置,以说明矩形宽度的设置属性对于折线是否相同,或者您必须更改它?

function newer() {
        document.getElementById("rectangle").setAttribute('width',"70");
}

它会像以下折线代码一样还是其他方式?

  function new() {
        document.getElementById("polyline1").setAttribute('points', "0,0 200,0 200,200 100,200 100,100 0,100 0,0" );
    }

假设我们谈论的是SVG折线(http://www.w3schools.com/svg/svg_polyline.asp),那么点是一个属性,"0,0 200,0 200,200 100,200 100,100 0,100 0,0"是属性值。

所以是的。