Corey Roth
1 min readJan 29, 2018

--

Data attributes are exactly intended to be manipulated in JS. You may use it to store additional information about an element in the DOM (metadata, in a way), but it’s just as correct to use an assignment like data-accordion=”accordion-header” or data-status=”open”. I’m just defining an additional attribute about that element — in this case, that it’s a header for an accordion component, that happens to currently be open.

--

--

Corey Roth
Corey Roth

Written by Corey Roth

Senior UX Designer at Amazon. Ultrarunner, creative, multilingual, & hopeless bleeding heart.

No responses yet