HTML: Custom Data Attribute
What is custom data attribute
Custom Data Attribute are user-defined attribute of HTML element.
The attribute's name must start with data-.
Example of custom data attribute
example of adding accessed date of a URL as data attribute.
<a href="http://example.com/some" data-accessed="2025-03-07">http://example.com/some</a>
Using javascript to access custom data attribute
You can use JavaScript DOM getAttribute method, like any other attribute.
Reference