What is the purpose of the `data-*` attribute in HTML, and give an example of its usage?

Instruction: Describe the `data-*` attribute and provide a practical example.

Context: This question evaluates the candidate's knowledge of custom data attributes in HTML and their ability to implement them in real-world scenarios.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

An example usage could be as follows: html <div class="post" data-post-id="12345" data-likes="340" data-shares="120" data-comments="45"> <!-- Post content here --> </div> In the above HTML snippet, each...

Related Questions