SVGNumberList
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
SVG number list interface
The SVGNumberList
defines a list of SVGNumber
objects.
An SVGNumberList
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
An SVGNumberList
is indexable and can be accessed like an array.
Interface overview
Also implement | None |
---|---|
Methods |
|
Properties |
|
Normative document | SVG 1.1 (2nd Edition) |
Instance properties
Name | Type | Description |
---|---|---|
numberOfItems |
unsigned long | The number of items in the list. |
length
Non-standard
|
unsigned long | The number of items in the list. |
Instance methods
Name & Arguments | Return | Description |
---|---|---|
clear() |
void |
Clears all existing current items from the list, with the result being an empty list. Exceptions:
|
initialize(in |
SVGNumber |
Clears all existing current items from the list and re-initializes the
list to hold the single item specified by
Exceptions:
|
getItem(in unsigned long index) |
SVGNumber |
Returns the specified item from the list. The returned item is the
item itself and not a copy. Any changes made to the item are
immediately reflected in the list. The first item is
number Exceptions:
|
insertItemBefore(in
|
SVGNumber |
Inserts a new item into the list at the specified position. The first
item is number
If
If the Exceptions:
|
replaceItem(in |
SVGNumber |
Replaces an existing item in the list with a new item. If
Exceptions:
|
removeItem(in unsigned long index) |
SVGNumber |
Removes an existing item from the list. Exceptions:
|
appendItem(in |
SVGNumber |
Inserts a new item at the end of the list. If
Exceptions:
|
Specifications
Specification |
---|
Scalable Vector Graphics (SVG) 2 # InterfaceSVGNumberList |
Browser compatibility
BCD tables only load in the browser