Reusable and Interactive Markup
Data Attributes
Store Page-Specific State
A deploy card stores status, owner, and action metadata with data attributes while keeping visible content readable.
Program
data-* attributes are global HTML attributes. They let markup carry page-specific values without inventing invalid attributes.
data_attributes.html
Visuals: captured from real browser rendering
<article class="data-card" data-status="ready" data-owner="ops">
<h2>Deploy window</h2>
<button data-action="approve">Approve</button>
</article>
Create the deploy card element.

The article remains semantic content even while it carries custom data. Store the card status.

A data attribute stores a custom state value in valid HTML. Store the owning team.

Multiple data attributes can describe the same element. Add the Approve button.

Buttons can carry both visible text and custom action metadata. Store the button action name.

Scripts can read dataset.action without changing the visible label.
data-*
data-* attributes store custom values that remain valid HTML.
dataset
Scripts can read data attributes through an element dataset.