What is the purpose of using "data-*" attributes?

  • To add semantic meaning to elements. 
  • To define new HTML attributes. 
  • To store configuration settings. 
  • To store custom data private to the page or application. 
The "data-*" attributes are a set of custom attributes provided by HTML5, allowing one to store custom data specific to individual elements. This embedded data can then be leveraged by scripts to create a more interactive user experience without any AJAX calls or server-side database queries. It's a way to store extra information directly in the markup, without resorting to non-standard attributes, invisible content, or other hacks. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *