+ /**
+ * Build the live regions markup.
+ *
+ * @since 4.3.0
+ *
+ * @param {String} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.
+ *
+ * @return {Object} $container The ARIA live region jQuery object.
+ */
+ function addContainer( ariaLive ) {
+ ariaLive = ariaLive || 'polite';
+
+ var $container = $( '<div>', {
+ 'id': 'wp-a11y-speak-' + ariaLive,
+ 'aria-live': ariaLive,
+ 'aria-relevant': 'additions text',
+ 'aria-atomic': 'true',
+ 'class': 'screen-reader-text wp-a11y-speak-region'
+ });
+
+ $( document.body ).append( $container );
+ return $container;
+ }
+
+ /**
+ * Clear the live regions.
+ *
+ * @since 4.3.0
+ */
+ function clear() {
+ $( '.wp-a11y-speak-region' ).text( '' );
+ }
+