# Function getCacheData

- getCacheData(element: Element, key?: string): any

  Gets cache data for a given element.

  #### Parameters

  - element: Element

    The DOM element to get data from.

  - `Optional` key: string

    The key (as a string) to retrieve. If not provided, returns all data.

  #### Returns any

  - The retrieved data for the given key or all data if no key is provided.
  - Defined in src/shared/dom.js:347