yatil / accessifyhtml5.js

While most browsers work all right with the new semantic elements of HTML5, they don’t add the ARIA accessibility attributes that the specification demands. This small JavaScript adds those attributes to enhance accessibility of web sites.
340 stars 30 forks source link

accessifyhtml5.js

The polyfill for a more accessible HTML5.

Which problem is solved with this polyfill?

While most browsers work all right with the new semantic elements of HTML5, they don’t add the ARIA accessibility attributes that the specification demands. This small JavaScript adds those attributes to enhance accessibility of web sites.

How to use accessifyhtml5.js?

Just link to the accessifyhtml5.js file and call the AccessifyHTML5-Function at the bottom of your page right before the closing </body> tag:

<script src="https://github.com/yatil/accessifyhtml5.js/raw/master/accessifyhtml5.js"></script>
<script>AccessifyHTML5();</script>

There are some options you’re able to specify as they can be on each web page only once.

Example:

<script src="https://github.com/yatil/accessifyhtml5.js/raw/master/accessifyhtml5.js"></script>
<script>
    AccessifyHTML5({
        header:"body>header",
        footer:"body>footer",
        main: "#main"
    });
</script>

jQuery

Important: From today on, 2013-03-27, the jQuery version of accessifyhtml5.js is deprecated. Use the vanilla JS version instead. (You can just replace the jQuery version with the non-jQuery JS file.)

<script src="https://github.com/yatil/accessifyhtml5.js/raw/master/accessifyhtml5.jquery.js"></script>
<script>AccessifyHTML5();</script>

CDN

I’ve created a small CDN that should serve the JS file quite fast. I recommend to use the code here and copy it to the bottom of your project’s HTML file. Code:

<script src="https://github.com/yatil/accessifyhtml5.js/raw/master//yatil-cdn.s3.amazonaws.com/accessifyhtml5.min.js"></script>
<script>AccessifyHTML5();</script>

Changelog

Version 2 (2013-03-27)

Version 1.5

Version 1.0

Version 1.0 beta

Acknowledgements:

Known Issues:

License:

This project is MIT licensed.

Author: