0892b2cf9e | ||
---|---|---|
.babelrc | ||
.eslintrc | ||
.gitignore | ||
LICENSE | ||
README.md | ||
index.js | ||
package-lock.json | ||
package.json | ||
test.html |
README.md
accessibilityjs
Client side accessibility error scanner.
Usage
import scanForProblems from 'accessibilityjs'
function logError(error, onPageWarning = true) {
error.element.addEventListener('click', function () {
alert(`${error.name}\n\n${error.message}`)
}, {once: true})
if (onPageWarning) error.element.classList.add('accessibility-error')
}
document.addEventListener('ready', function() {
scanForProblems(document, logError)
})
Browser support
- Chrome
- Firefox
- Safari 6+
- Internet Explorer 9+
- Microsoft Edge
Internet Explorer and Edge require a polyfill for closest
.
Development
Test script changes with test.html
.