Back to Content

SVGLengthList: appendItem() method

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

latest779 B
Original Source

{{APIRef("SVG")}}

The appendItem() method of the {{domxref("SVGLengthList")}} interface inserts a new item at the end of the list. If the given item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.

Syntax

js-nolint
appendItem(newItem)

Parameters

  • newItem
    • : The {{domxref("SVGLength")}} to add to the list.

Return value

The {{domxref("SVGLength")}} that was added to the list.

Exceptions

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

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}