Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. SVGPathElement
  4. pathLength

SVGPathElement: pathLength property

ThepathLength read-only property of theSVGPathElement interface reflects thepathLength attribute of the given<path> element.

Value

AnSVGAnimatedNumber.

Examples

Accessing thepathLength Property

html
<svg width="200" height="100">  <path d="M 0,30 h100" pathLength="50" /></svg>
js
const pathElement = document.getElementById("myPath");// Access the pathLength propertyconst animatedNumber = pathElement.pathLength;// The base value of the pathLength attributeconsole.log(animatedNumber.baseVal); // Output: 100

Specifications

Specification
SVG Paths
# __svg__SVGPathElement__pathLength

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp