SVGPolygonElement: Eigenschaft points
Baseline
Weitgehend verfügbar
Diese Funktion ist gut etabliert und funktioniert auf vielen Geräten und in vielen Browserversionen. Sie ist seit Juli 2015 browserübergreifend verfügbar.
Die schreibgeschützte Eigenschaft points des SVGPolygonElement-Interfaces spiegelt den Basiswert (d.h. statischen Wert) des points-Attributs des Elements wider. Änderungen über das SVGPointList-Objekt werden im points-Attribut widergespiegelt und umgekehrt.
Wert
Ein SVGPointList-Objekt.
Beispiele
>Zugriff auf die points-Eigenschaft
html
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200">
<polygon id="myPolygon" points="100,10 150,50 100,90 50,50" fill="blue" />
</svg>
js
const polygonElement = document.getElementById("myPolygon");
// Access the points property
console.dir(polygonElement.points); // Output: SVGPointList object containing points (100,10), (150,50), (100,90), (50,50)
Spezifikationen
| Spezifikation |
|---|
| Scalable Vector Graphics (SVG) 2> # __svg__SVGAnimatedPoints__points> |