data anything Attributes
data-* attributes
The data-* attributes are used to store custom data private to the page or application. It gives the ability to embed custom data attributes on all present HTML attributes. Its main use is with JavaScript to perform different tasks. It consists of two parts:-
- The attribute name should not be in uppercase and at least one character after data-.
- The value can be any string.
Attribute Explanation:-
Value | Description |
---|---|
anyvalue | Specifies the value of the attribute. |
Syntax:-
Its syntax is:- < element data-*="anyvalue" >