HTML

HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes

FAQs

data anything Attributes

data-* attributes

 

 

The data-* attributes are used to store custom data private to the page or application. It gives the ability to embed custom data attributes on all present HTML attributes. Its main use is with JavaScript to perform different tasks. It consists of two parts:-

  • The attribute name should not be in uppercase and at least one character after data-.
  • The value can be any string.

 

Attribute Explanation:-

 

Value Description
anyvalue Specifies the value of the attribute.

 

Syntax:-

 

Its syntax is:- < element data-*="anyvalue" >

Code Explanation

All Tutorials related to HTML Global Attributes

All Sections related to HTML