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
assignstatic

Updates data connected to specified element.

ParameterTypeDescription
elementHTMLElement

DOM element

dataObject

Data to assign

getstatic

Get the data that is connected to a specified element or just a specific key.

ParameterTypeDescription
elementHTMLElement

DOM element

keyString

The name of the property in the element data to return

Returns: *
removestatic

Remove the specified key from the data connected to a given element.

ParameterTypeDescription
elementHTMLElement

DOM element

keyString

The name of the property in the element data to remove.

setstatic

Sets all data connected to specified element (completely replacing any existing) or just a specific key. To update data, use DomDataStore#assign instead.

ParameterTypeDescription
elementHTMLElement

DOM element

dataObject | 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.

Returns: * -

The value or data passed.