W3cubDocs

/Web APIs

SVGGeometryElement: getTotalLength() method

The SVGGeometryElement.getTotalLength() method returns the user agent's computed value for the total length of the path in user units.

Syntax

js

getTotalLength()

Parameters

None.

Return value

A float indicating the total length of the path in user units.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getTotalLength 56
1–56Only supported for SVGPathElement, not all SVGGeometryElement objects.
79
12–79Only supported for SVGPathElement, not all SVGGeometryElement objects.
61
1.5–61Only supported for SVGPathElement, not all SVGGeometryElement objects.
9Only supported for SVGPathElement, not all SVGGeometryElement objects.
43
≤12.1–43Only supported for SVGPathElement, not all SVGGeometryElement objects.
12
3–12Only supported for SVGPathElement, not all SVGGeometryElement objects.
56
≤37–56Only supported for SVGPathElement, not all SVGGeometryElement objects.
56
18–56Only supported for SVGPathElement, not all SVGGeometryElement objects.
61
4–61Only supported for SVGPathElement, not all SVGGeometryElement objects.
43
≤12.1–43Only supported for SVGPathElement, not all SVGGeometryElement objects.
12
1–12Only supported for SVGPathElement, not all SVGGeometryElement objects.
6.0
1.0–6.0Only supported for SVGPathElement, not all SVGGeometryElement objects.

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/getTotalLength