Intermediate
HTML & CSS
Q60 / 100
What is the purpose of the "data-*" custom attributes in HTML, e.g. "data-user-id=\"42\""?
Correct! Well done.
Incorrect.
The correct answer is B) They allow storing custom, application-specific data on HTML elements that can be accessed via CSS attribute selectors or JavaScript's dataset property
B
Correct Answer
They allow storing custom, application-specific data on HTML elements that can be accessed via CSS attribute selectors or JavaScript's dataset property
Explanation
data-* attributes provide a standardized way to embed custom data private to the page/application, retrievable in JS via element.dataset.userId.
Progress
60/100