Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is HTML 5 supported by all the main browsers?

I am looking at the custom attributes feature of html 5 here at this link http://ejohn.org/blog/html-5-data-attributes/

This look like the perfect thing for when I am using jquery/javascript.

My question, Is HTML 5 supported by all the main browsers?

example

<li class="user" data-name="John Resig" data-city="Boston"
     data-lang="js" data-food="Bacon">
  <b>John says:</b> <span>Hello, how are you?</span>
</li>
like image 496
JasonDavis Avatar asked Aug 30 '09 22:08

JasonDavis


3 Answers

Various portions of HTML5 are supported by the different browsers, for various definitions of 'supported'.

Several parts work right now, reliably. The data-* attributes you ask about in your question work just fine in every browser, even IE6; however, nobody yet supports the fun "dataset" method to access them. As long as you're fine with just grabbing them by the full attr name, you're golden. I use them to store state all the time in my webapps, as they're the officially blessed method for doing so.

Wikipedia has a good summary of the various support levels across browsers: http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)

like image 63
Xanthir Avatar answered Sep 18 '22 10:09

Xanthir


Parts of HTML 5 are supported by Safari, Firefox and Opera, but they are not necessarily incorporating the same parts.

It seems that Firefox is the most ahead, from my experience, but it will be years before the majority of browsers users use will support it.

So, until then we will need to continue trying to use it when we can, in browsers that support the new features, and having workarounds for users that haven't updated yet, or continue to use IE.

like image 35
James Black Avatar answered Sep 19 '22 10:09

James Black


Use some services like http://caniuse.com/

For example for your question - http://caniuse.com/dataset

As you can see all modern browsers support it

Also you can use something like http://modernizr.com/ in your code (it's already included in http://html5boilerplate.com/)

PS: just notified that this question is too old, but it was linked to some other question i checked before

like image 44
llamerr Avatar answered Sep 19 '22 10:09

llamerr