The SVGStringList
defines a list of strings.
An SVGStringList
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
The SVGStringList
defines a list of strings.
An SVGStringList
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Also implement | None |
---|---|
Methods |
|
Properties |
|
Normative document | SVG 1.1 (2nd Edition) |
Name | Type | Description |
---|---|---|
numberOfItems | unsigned long | The number of items in the list. |
length | unsigned long | A mirror of the value in numberOfItems , for consistency with other interfaces. Non-standard |
Name & Arguments | Return | Description |
---|---|---|
clear() | void | Clears all existing current items from the list, with the result being an empty list. Exceptions:
|
initialize(string newItem) | string | Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted 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. The return value is the item inserted into the list. Exceptions:
|
getItem(number index) | string | 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 0. Exceptions:
|
insertItemBefore(string newItem, number index) | string | Inserts a new item into the list at the specified position. The first item is number 0. If Exceptions:
|
replaceItem(string newItem, number index) | string | Replaces an existing item in the list with a new item. If Exceptions:
|
removeItem(in unsigned long index) | string | Removes an existing item from the list. Exceptions:
|
appendItem(string newItem) | string | Inserts a new item at the end of the list. If Exceptions:
|
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
SVGStringList |
1 | 12 | 12Since version 13,SVGStringList is indexable like Array which is a non-standard behavior. |
9 | ≤12.1 | 3 | 3 | 18 | 14SVGStringList is indexable like Array which is a non-standard behavior. |
≤12.1 | 1 | 1.0 |
appendItem |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
clear |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
getItem |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
initialize |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
insertItemBefore |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
length |
35 | 79 | 12 | No | ≤12.1 | 13.1 | 37 | 35 | 14 | ≤12.1 | 13.4 | 3.0 |
numberOfItems |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
removeItem |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
replaceItem |
1 | 12 | 12 | 9 | ≤12.1 | 3 | 3 | 18 | 14 | ≤12.1 | 1 | 1.0 |
© 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/SVGStringList