Using the alert role – Accessibility | MDN

Using the alert role

Description

This technique demonstrates how to use the alert role and describes the effect it has on browsers and assistive technology.

The alert role is used to communicate an important and usually time-sensitive message to the user. When this role is added to an element, the browser will send out an accessible alert event to assistive technology products which can then notify the user about it. The alert role is most useful for information that requires the user’s immediate attention, for example:

  • An invalid value was entered into a form field
  • The user’s login session is about to expire
  • The connection to the server was lost, local changes will not be saved

Because of its intrusive nature, the alert role must be used sparingly and only in situations where the user’s immediate attention is required. Dynamic changes that are less urgent should use a less aggressive method, such as aria-live=”polite” or other live region roles.

Possible effects on user agents and assistive technology

When the alert role is added to an element, or such an element becomes visible, the user agent should do the following:

  • Expose the element as having an alert role in the operating system’s accessibility API.
  • Fire an accessible alert event using [...]

Read article at developer.mozilla.org

Article Taxonomies

Categories:
Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /home/webable/www/www/wp-content/themes/webable/content-mcm.php:65 Stack trace: #0 /home/webable/www/www/wp-includes/template.php(812): require() #1 /home/webable/www/www/wp-includes/template.php(745): load_template('/home/webable/w...', false, Array) #2 /home/webable/www/www/wp-includes/general-template.php(206): locate_template(Array, true, false, Array) #3 /home/webable/www/www/wp-content/themes/webable/single-mcm_article.php(15): get_template_part('content-mcm') #4 /home/webable/www/www/wp-includes/template-loader.php(106): include('/home/webable/w...') #5 /home/webable/www/www/wp-blog-header.php(19): require_once('/home/webable/w...') #6 /home/webable/www/www/index.php(17): require('/home/webable/w...') #7 {main} thrown in /home/webable/www/www/wp-content/themes/webable/content-mcm.php on line 65