Categories
HTML

How to store arbitrary data for some HTML tags?

Spread the love

To store arbitrary data for some HTML tags, we put the data in the data- attributes.

For instance, we write

<div data-internalid="123"></div>

to set the data-internal attribute of the div to 123.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *