129 of 133 menu

The data- attribute

The data- attribute is used to create attributes with their own names. Such attributes are used to store various data in HTML markup.

How to create your own attributes: their names should start with data-, followed by a name of your own. Attributes created this way will be validated.

Example

Let's use the data- attribute to store the day, month, and year:

<span data-day="12" data-month="03" data-year="2015">text</span>

:

See also

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline