Skip to main content
HTML Code Completion Medium +20 XP

Data Attribute

Complete the custom data attribute.

HTMLFill in the blank
<button ___-user-id="42">View Profile</button>

Type the missing code

Show answer and explanation

Answer: data

data-* attributes store custom data in HTML elements. They're accessible via JavaScript's dataset property.

Hint: Custom HTML attributes start with this prefix.

What this challenge tests

Code Completion in HTML: data-attributes, custom.

Related challenges