New Selectors Available
This isn’t exactly HTML5, but I thought I would share it with you anyway. Until recently, to be able to get elements from the DOM which did not have an ID was tricky. So people use the sizzle javascript library or jQuery (which has the sizzle library)
var $el = $('#navbar > ul > li:first-child a');
Now however there are a few extra functions available to you using just standard javascript.
If you want all the elements of a certain class, you can use:
var elements = document.getElementsByClassName('className');
Or to get multiple classes:
var elements = document.getElementsByClassName('className otherClass');
This will fetch all the elements OF either classThere are also a few other functions available to you:
var first = document.querySelector('navbar > ul > li:first-child a');
var ajax_as = document.querySelectorAll('a.ajax');
These functions use all the new css selectors available with css3 :)
To view a demo of these in action click here
To view some sample code click here
The official specification