Friday 15 February 2013

html - what is the purpose and usage of data-value, data-title, data-original-title, original-title, etc.? -


I have been looking at these features on more modern websites such as GitHub, and they always used to match with customized < PopOver like code> title attribute.

  & lt; A href = "/" data-value = "hovering message" & gt; Option 1 & lt; / A & gt; & Lt; A href = "/" data-title = "hovering message" & gt; Option 2 & lt; / A & gt; & Lt; A href = "/" data-base-title = "hovering message" & gt; Option 3 & lt; / A & gt; & Lt; A href = "/" original-title = "hovering message" & gt; Option 4 & lt; / A & gt;   

I have read some documents about the data-attributes on the HTML 5 doctor, and I am not sure of this.

Do some SEO or accessibility benefits them? And what plugin (hopefully jQuery) is usually used to create popovers in this specific case?

Simply, the specification for custom data attributes indicates that any attribute with 'data' Begins to be considered as a storage area for personal data (it is private in the sense that the end user can not see it, which does not affect layout or presentation).

This allows you to write valid HTML markup (passing an HTML5 vendor) while simultaneously embedding data inside your page. A quick example:

  & lt; Li class = "user" data-name = "John resig" data-city = "Boston" data-lang = "js" data-feed = "bacon" & gt; & Lt; B & gt; John says: & lt; / B & gt; & Lt; Span & gt; Hello, how are you? & Lt; / Span & gt; & Lt; / Li & gt; From:   

From: 'External link is not certain about policy, just keep it here and know someone in case.'

No comments:

Post a Comment