chapmanu/fragmentions — pull request #6 by yatil (2014-04-21 07:36:39+00:00)
Title: Add accessibility features

While a visual user is pointed at the right piece of text, non-visual & keyboard users are not and have to start at the beginning of the document.

Setting `element.setAttribute('tabindex', '0');` makes the element focusable, even if it is only a div or a paragraph, so we can `focus` the element easily. This also provides the opportunity to style the fragmention diffetently while it has the focus, using the `[fragmention]:focus` selector.

(Note: I personally prefer to have the attribute as `data-fragmention`, using the HTML5 data attributes.)