HtmlCollection Class
https://dom.spec.whatwg.org/#interface-htmlcollection
public class HtmlCollection : IEnumerable<Element>, IReadOnlyCollection<Element>, IReadOnlyList<Element>, IEnumerableProperties
| Name | Description |
|---|---|
| Count | Gets the number of elements in the collection. |
| Length | Gets the number of elements in the collection. |
Count
HtmlCollection.csLength
HtmlCollection.csGets the number of elements in the collection.
public uint Length { get; }Indexers
| Name | Description |
|---|---|
| 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
this[int]
HtmlCollection.csthis[string]
HtmlCollection.csGets the first element with the given id or name, or null when there is none.
this[uint]
HtmlCollection.csGets the element at the given index, or null when the index is out of range.
Methods
| Name | Description |
|---|---|
| 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.csReturns 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.
Item(uint)
HtmlCollection.csReturns the element at the given index, or null when the index is out of range.
NamedItem(string)
HtmlCollection.cshttps://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key