# Function getOrSetCacheData

- getOrSetCacheData(element, key, value?): any

- Gets or sets cache data for a given element.

  #### Parameters

  - element: Element

    The DOM element to get or set data on.

  - key: any

    The key (as a string) to get/set or an object for mass-setting.

  - `Optional` value: any

    The value to set. If not provided, the function acts as a getter.

  #### Returns any

  - The retrieved data if acting as a getter. Otherwise, returns undefined.
  - Defined in shared/jqlite/jqlite.js:919