What’s the difference between element value and data attribute ?
Element value: HTML element is the collection of start and end tag with the content inserted in between them.
Data Attribute: Data Attributes allow you to add your own information to tags in HTML. Even though the name suggests otherwise, these are not specific to HTML5
The element value can be implemented using HTML elements <input>,
<button>,<meter>,<li>,<option>,<progress>and <param> elements only.
|The data attribute can be used with all HTML elements.|
It is used differently for different elements. For example, the <button>,<input> elements values specifies the initial value of the element.
For <param> elements, the value attribute specifies the value of the parameter.
|It is used to define custom data attributes and to store custom data, private to the page or application.|
|For element value, we don’t need to give any name to it. The value must be a string.||The attribute name cannot have any uppercase letters, and must be at least one character long and the prefix with ‘data-‘.|