What are data- attributes good for?

Before JavaScript frameworks became popular, front end developers used data- attributes to store extra data within the DOM itself, without other hacks such as non-standard attributes, extra properties on the DOM.

 

It is intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements.

What are data- attributes good for? Before JavaScript frameworks became popular, front end developers used data- attributes to store extra data within the DOM itself, without other hacks such as non-standard attributes, extra properties on the DOM. It is intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements.

What are data- attributes good for?

By Code 100mph

What are data- attributes good for?

  • 249