Sunday, April 13, 2014

HTML 5 Data-* Attribute

Data-* attribute is special novelty in HTML 5 that can be used for own purposes.

For example, we can use our own data-author, data-title, data-text, data-car-model attributes (anything starting with data-) and it will be valid HTML. Custom data attribute can be used on any element:

<span data-author>Miguel de Cervantes Saavedra</span>
<span data-title>Don Quixote</span>


One of the big architecture flaw appears: there is no namespace!
And I predict there will be lots of conflicts, especially when one famous javascript framework will use same data- designation as another framework, or it will conflict with you own clear attribute names.
Microsoft already uses data-* attributes in ASP.NET MVC for validation.


1 comment:

  1. If you ever struggle with QuickBooks related troubles, just dial our Quickbooks Customer Service Number 1-833-325-0220 and take advantage of an excellent service benefits from our QB experts with 24*7 hours of availability. Read More: https://g.page/quickbookssupporttexas?gm

    ReplyDelete