# Function setCacheData

- setCacheData(element: Node | Element, key: string, value?: any): void

  Sets cache data for a given element.

  #### Parameters

  - element: Node | Element

    The DOM element to get or set data on.

  - key: string

    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 void

  - Defined in src/shared/dom.js:327