Using $el.data()
associates a value to the element and is stored in a object stored in memory by jQuery. This object is keyed by the element itself.
The $.data()
method allows you access to all data attributes stored by jQuery, and you can retrieve them by providing the key element required.