'use strict';
var $containerPolite,
- $containerAssertive,
- role;
+ $containerAssertive;
/**
* Update the ARIA live notification area text node.
// Clear previous messages to allow repeated strings being read out.
clear();
+ // Ensure only text is sent to screen readers.
+ message = $( '<p>' ).html( message ).text();
+
if ( $containerAssertive && 'assertive' === ariaLive ) {
$containerAssertive.text( message );
} else if ( $containerPolite ) {
*/
function addContainer( ariaLive ) {
ariaLive = ariaLive || 'polite';
- role = 'assertive' === ariaLive ? 'alert' : 'status';
var $container = $( '<div>', {
'id': 'wp-a11y-speak-' + ariaLive,
- 'role': role,
'aria-live': ariaLive,
'aria-relevant': 'additions text',
'aria-atomic': 'true',