user3858890
user3858890

Reputation: 117

HTML tag properties

I see on some tags using "unusual" properties like the data-id and data-gps-track properties on <a> tag.Also aria-hidden property on h3 tag and so on...So my question is are these "official" tags or everyone can write a property on his own?

Upvotes: 0

Views: 132

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201886

The attribute mentioned in the question are allowed according to HTML5 Last Call Working Draft, which is the current W3C working group document on HTML5. Whether you call it “official” is your choice. The document itself says: “ This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.” However, many people regard the W3C HTML5 document as “standard”.

According to HTML5, authors can use data-* attributes for their own purposes. No meaning is assigned to them in the specification, and no meaning will be assigned to them in specifications. So they are a “standard” way of using custom attributes.

The aria-* attributes are not defined in HTML5, but HTML5 normatively refers to ARIA specifications for their definitions and permits using them. They have defined meanings, and their set is fixed (though it may be changed by future changes to ARIA specifications).

Upvotes: 1

James
James

Reputation: 3293

It's new* in HTML5. You can create your own data-* attributes. There is some handy usage when combining with Javascript.

Here is a pretty good run down.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes

Upvotes: 1

Related Questions