SVG string list interface
The SVGStringList defines a list of DOMString objects.
An SVGStringList object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
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
|
A mirror of the value in numberOfItems, for consistency with other interfaces. '
|
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 DOMString newItem)
|
DOMString
|
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(in unsigned long index)
|
DOMString
|
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(in DOMString newItem, in unsigned long index)
|
DOMString
|
Inserts a new item into the list at the specified position. The first item is number 0. If Exceptions:
|
replaceItem(in DOMString newItem, in unsigned long index)
|
DOMString
|
Replaces an existing item in the list with a new item. If Exceptions:
|
removeItem(in unsigned long index)
|
DOMString
|
Removes an existing item from the list. Exceptions:
|
appendItem(in DOMString newItem)
|
DOMString
|
Inserts a new item at the end of the list. If Exceptions:
|
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SVGStringList
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox Full support 12 Full support 12 Notes' Since version 13, |
IE
Full support 9 |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android Full support 14 Full support 14 Notes' |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
|
|
Chrome
Full support Yes |
Edge
Full support ≤79 |
Firefox
Full support 13 |
IE
No support No |
Opera
Full support Yes |
Safari
? |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 14 |
Opera Android
Full support Yes |
Safari iOS
? |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.'
- Non-standard. Expect poor cross-browser support.
- See implementation notes.'
- See implementation notes.
SVGStringList by Mozilla Contributors is licensed under CC-BY-SA 2.5.