What are Data-Attributes in HTML5
Data attributes allow us to store information on HTML elements. There are many ways to use these attributes. Before this, we have to depend on class attributes to store some information. In this article, will look into some examples and usage of data attributes.
Suppose, if we are creating an application and we might want to store some information. we could do so by assigning custom data attributes. This data can be used for searching, filtering or grouping. These data is ignored by the browsers. You may provide as many data attributes in the element.
The data attribute is always prefixed with data-.
Originally published at www.voltspecter.com.