---
title: "HTMLCollectionBase | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

# Interface HTMLCollectionBase

The **`HTMLCollection`** interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection)

interface HTMLCollectionBase {  
    [length](#length): number;  
    ["\[iterator\]"](#iterator-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/)\>;  
    [item](#item-1)(index: number): [Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/) | null;  
    \[index: number\]: [Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/);  
}

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.HTMLCollectionBase))

-   HTMLCollectionBase
    -   [HTMLCollectionOf](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCollectionOf/)
    -   [HTMLCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCollection/)
    -   [HTMLFormControlsCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLFormControlsCollection/)

#### Indexable

-   \[index: number\]: [Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/)
    

##### Index

### Properties[](#properties)

[length](#length)

### Methods[](#methods)

[\[iterator\]](#iterator) [item](#item)

## Properties[](#properties-1)

### `Readonly`length[](#length)

length: number

The **`HTMLCollection.length`** property returns the number of items in a HTMLCollection.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length)

## Methods[](#methods-1)

### \[iterator\][](#iterator)

-   "\[iterator\]"(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/)\>[](#iterator-1)
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/)\>
    

### item[](#item)

-   item(index: number): [Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/) | null[](#item-1)
    
    The HTMLCollection method **`item()`** returns the element located at the specified offset into the collection.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)
    
    #### Parameters
    
    -   index: number
    
    #### Returns [Element](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Element/) | null
