Accessibilityjs

accessibilityjs

Client side accessibility error scanner.

accessibilityjs with 0 dependenices does an wonderful job in scaning and reproting accessibility issues for a given page.

It currently can scan and report the bleow problems:

  • ImageWithoutAltAttributeError
  • ElementWithoutLabelError
  • LinkWithoutLabelOrRoleError
  • LabelMissingControlError
  • InputMissingLabelError
  • ButtonWithoutLabelError
  • ARIAAttributeMissingError

Get it: npm install accessibilityjs

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
import {scanForProblems} from 'accessibilityjs'

function logError(error) {
  error.element.classList.add('accessibility-error')
  error.element.addEventListener('click', function () {
    alert(`${error.name}\n\n${error.message}`)
  }, {once: true})
}

document.addEventListener('DOMContentLoaded', function() {
  scanForProblems(document, logError)
})

GIF FTW!

accessibilityjs

Suggest a module

Comments