SVGNumberList
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.
Note: Starting in Gecko 5.0,the SVGNumberList
DOM interface is now indexable and can be accessed like arrays.
Interface overview
Also implement | None |
---|---|
Methods |
|
Properties |
|
Normative document | SVG 1.1 (2nd Edition) |
Properties
Name | Type | Description |
---|---|---|
numberOfItems | unsigned long | The number of items in the list. |
length
| unsigned long | The number of items in the list. |
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:
|
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 | |
SVGNumberList |
5 |
12 |
1.5 |
9 |
≤12.1 |
5 |
≤37 |
18 |
4 |
≤12.1 |
4 |
1.0 |
appendItem |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
clear |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
getItem |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
initialize |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
insertItemBefore |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
length |
35 |
79 |
5 |
No |
≤12.1 |
13.1 |
37 |
35 |
5 |
≤12.1 |
13.4 |
3.0 |
numberOfItems |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
removeItem |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
replaceItem |
6 |
12 |
3 |
10 |
≤12.1 |
6 |
≤37 |
18 |
4 |
≤12.1 |
6 |
1.0 |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGNumberList