@wordpress/a11y
Version:
Accessibility (a11y) utilities for WordPress.
22 lines (20 loc) • 611 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = clear;
/**
* Clears the a11y-speak-region elements and hides the explanatory text.
*/
function clear() {
const regions = document.getElementsByClassName('a11y-speak-region');
const introText = document.getElementById('a11y-speak-intro-text');
for (let i = 0; i < regions.length; i++) {
regions[i].textContent = '';
}
// Make sure the explanatory text is hidden from assistive technologies.
if (introText) {
introText.setAttribute('hidden', 'hidden');
}
}
//# sourceMappingURL=clear.js.map
;