DomTokenList Class
https://dom.spec.whatwg.org/#interface-domtokenlist
public sealed class DomTokenList : IEnumerable<string>, IReadOnlyCollection<string>, IReadOnlyList<string>, IEnumerableProperties
| Name | Description |
|---|---|
| Count | Gets the number of tokens in the list. |
| Length | Gets the number of tokens in the list. |
| Value | Gets or sets the value of the associated attribute, as a string. |
Count
DomTokenList.csLength
DomTokenList.csGets the number of tokens in the list.
public uint Length { get; }Value
DomTokenList.csGets or sets the value of the associated attribute, as a string.
public string Value { get; set; }Indexers
| Name | Description |
|---|---|
| this[int] | Gets the token at the given index. |
| this[uint] | Gets the token at the given index, or null when the index is out of range. |
ItemAt overloads
this[int]
DomTokenList.csthis[uint]
DomTokenList.csGets the token at the given index, or null when the index is out of range.
Methods
| Name | Description |
|---|---|
| Add(IReadOnlyList<string>) | Adds the given tokens to the list, ignoring those already present. |
| Contains(string) | Returns whether the list contains the given token. |
| GetEnumerator() | Returns an enumerator that iterates through the collection. |
| Item(uint) | Returns the token at the given index, or null when the index is out of range. |
| Remove(IReadOnlyList<string>) | Removes the given tokens from the list. |
| Replace(string, string) | https://dom.spec.whatwg.org/#dom-domtokenlist-replace |
| Supports(string) | https://dom.spec.whatwg.org/#dom-domtokenlist-supports |
| System.Collections.Generic.IReadOnlyList<System.String>.get_Item(int) | |
| System.Collections.IEnumerable.GetEnumerator() | |
| ToString() | Returns a string that represents the current object. |
| Toggle(string, bool?) | https://dom.spec.whatwg.org/#dom-domtokenlist-toggle |
Add(IReadOnlyList<string>)
DomTokenList.csAdds the given tokens to the list, ignoring those already present.
public void Add(params IReadOnlyList<string> tokens)Contains(string)
DomTokenList.csReturns whether the list contains the given token.
GetEnumerator()
DomTokenList.csReturns an enumerator that iterates through the collection.
public IEnumerator<string> GetEnumerator()Returns
IEnumerator<string> An enumerator that can be used to iterate through the collection.
See also
Item(uint)
DomTokenList.csReturns the token at the given index, or null when the index is out of range.
Remove(IReadOnlyList<string>)
DomTokenList.csRemoves the given tokens from the list.
public void Remove(params IReadOnlyList<string> tokens)Replace(string, string)
DomTokenList.csSupports(string)
DomTokenList.cshttps://dom.spec.whatwg.org/#dom-domtokenlist-supports