DOMTokenList Class

DOMTokenList class

The DOMTokenList class represents a set of space-separated tokens. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive.

public class DOMTokenList : DOMObject, IEnumerable<string>

Properties

NameDescription
Item { get; }Returns the item in the list by its index, or null if index is greater than or equal to the list’s length.
Length { get; }Returns an ulong which represents the number of tokens stored in this list.
Value { get; set; }Gets or sets the value of a corresponding attribute.

Methods

NameDescription
Add(params string[])Adds the specified token(s) to the list.
Contains(string)Returns true if the list contains the given token, otherwise false.
GetEnumerator()Returns an enumerator that iterates through the collection.
virtual GetPlatformType()This method is used to retrieve ECMAScript object Type.
Remove(params string[])Removes the specified token(s) from the list.
Replace(string, string)Replaces an existing token with a new token. Does nothing if the first token doesn’t exist.
Supports(string)Returns true if a given token is in the associated attribute’s supported tokens.
Toggle(string)Removes the token from the list if it exists, or adds the token to the list if it doesn’t.
Toggle(string, bool)Removes the token from the list if it exists, or adds the token to the list if it doesn’t.

See Also