SVGPointList: length 屬性
SVGPointList 介面的只讀屬性 length 返回列表中的專案數。
值
列表中專案的數量。
示例
以下示例顯示了一個包含五個座標對的 <polyline> 的 SVG。length 屬性返回 5。
html
<svg id="svg" viewBox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg">
<polyline
id="example"
stroke="black"
fill="none"
points="50,0 21,90 98,35 2,35 79,90" />
</svg>
js
let example = document.getElementById("example");
console.log(example.points.length); // 5
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGNameList__length |
瀏覽器相容性
載入中…