The new defacto standard HTML5 element support library.
HTML5.js still needs a little work to be worthy of the title "Best in Class". Please, feel free to contribute additional unit tests or documentation.
The documentation for HTML5.js can be viewed here: /doc/README.md
For a list of upcoming features, check out our roadmap.
In a browser:
<script src="html5.js"></script>
In an AMD loader like RequireJS:
require({
'paths': {
'html5': 'path/to/html5'
}
},
['html5'], function(html5) {
console.log(html5.support);
});
Usage example:
// create an element
html5.createElement('div');
// or a document fragment that supports parsing/styling HTML5 elements
html5.createDocumentFragment();
// install support extensions with an options object
html5.install({
// overwrite the document's `createElement` and `createDocumentFragment`
// methods with `html5.createElement` and `html5.createDocumentFragment` equivalents.
'methods': true,
// add support for printing HTML5 elements
'print': true,
// add minimal default HTML5 element styles
'styles': true
});
// or with an options string
html5.install('print styles');
// or using a shortcut to install all support extensions
html5.install('all');