HtmlCollection Class

https://dom.spec.whatwg.org/#interface-htmlcollection

Implements

Properties

NameDescription
CountGets the number of elements in the collection.
LengthGets the number of elements in the collection.

Gets the number of elements in the collection.

public int Count { get; }

Property value

int

Gets the number of elements in the collection.

public uint Length { get; }

Indexers

NameDescription
this[int]Gets the element at the given index.
this[string]Gets the first element with the given id or name, or null when there is none.
this[uint]Gets the element at the given index, or null when the index is out of range.

ItemAt overloads

Gets the element at the given index.

public Element this[int index] { get; }
Parameters
index int
Property value

Element

this[string]

HtmlCollection.cs

Gets the first element with the given id or name, or null when there is none.

public Element? this[string name] { get; }

Gets the element at the given index, or null when the index is out of range.

public Element? this[uint index] { get; }

Methods

NameDescription
GetEnumerator()Returns an enumerator that iterates through the collection.
Item(uint)Returns the element at the given index, or null when the index is out of range.
NamedItem(string)https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key
System.Collections.Generic.IReadOnlyList<Meziantou.Framework.WebPlatform.Dom.Element>.get_Item(int)
System.Collections.IEnumerable.GetEnumerator()

GetEnumerator()

HtmlCollection.cs

Returns an enumerator that iterates through the collection.

public IEnumerator<Element> GetEnumerator()

Returns

IEnumerator<Element> An enumerator that can be used to iterate through the collection.

Returns the element at the given index, or null when the index is out of range.

public Element? Item(uint index)

NamedItem(string)

HtmlCollection.cs

https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key

public virtual Element? NamedItem(string key)

System.Collections.Generic.IReadOnlyList<Meziantou.Framework.WebPlatform.Dom.Element>.get_Item(int)

Element IReadOnlyList<Element>.get_Item(int index)

Parameters

index int

Returns

Element

No documentation is available.

System.Collections.IEnumerable.GetEnumerator()

HtmlCollection.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.