DomDataStore
Stores data on a dom element (by setting element._domData). Instead of using HTML5:s element.dataset, which turned out to be slow.
Functions
4
Functions
4Updates data connected to specified element.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | DOM element |
data | Object | Data to assign |
Get the data that is connected to a specified element or just a specific key.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | DOM element |
key | String | The name of the property in the element data to return |
Remove the specified key from the data connected to a given element.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | DOM element |
key | String | The name of the property in the element data to remove. |
Sets all data connected to specified element (completely replacing any existing) or just a specific key. To update data, use DomDataStore#assign instead.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | DOM element |
data | Object | String | Data object to set, or property name to set |
value | * | If the previous parameter was a property name, this is the value to set. |
The value or data passed.