15c493a296 | ||
---|---|---|
.eslintrc | ||
.gitignore | ||
LICENSE | ||
README.md | ||
index.js | ||
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
.