Back to Content

SVGLengthList: clear() method

files/en-us/web/api/svglengthlist/clear/index.md

latest543 B
Original Source

{{APIRef("SVG")}}

The clear() method of the {{domxref("SVGLengthList")}} interface clears all existing items from the list, with the result being an empty list.

Syntax

js-nolint
clear()

Parameters

None.

Return value

None ({{jsxref("undefined")}}).

Exceptions

  • NoModificationAllowedError {{domxref("DOMException")}}
    • : Thrown when the list is read-only.

Examples

See {{domxref("SVGLengthList")}} for a complete example.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}