0Pricing
Web Accessibility Academy · Lección

polite frente a assertive: elegir la urgencia

Decida si una actualización interrumpe al usuario.

polite frente a assertive: elegir la urgencia es una lección gratuita de Web Accessibility Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Web Accessibility Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Web Accessibility Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

What a Live Region Is

A live region is an element a screen reader watches, so it speaks any text that changes inside it without the user moving focus there.

Two Politeness Levels

The aria-live attribute has two useful values you will reach for constantly: polite and assertive. They decide how an update is delivered. 🔊

Polite Waits Its Turn

With polite, the screen reader finishes whatever it is saying, then reads your update. It never cuts the user off mid-sentence.

<div aria-live="polite">Draft saved</div>

Assertive Interrupts Now

With assertive, the screen reader stops what it is reading and announces your update right away. Use it only when waiting would cost the user.

<div aria-live="assertive">Connection lost</div>

Polite Is the Default Choice

Reach for polite almost every time. Save, sort, filter, and progress updates can all wait a beat without confusing anyone.

Save Assertive for Real Urgency

Use assertive only for things the user must hear immediately, like a failed payment or a session about to expire.

There Is Also Off

The value off tells the screen reader to ignore changes in that element. It is the implicit default for elements you have not marked as live.

<div aria-live="off">Silent updates</div>

The Region Must Exist First

The live element should be in the DOM before the text changes. Screen readers watch existing regions, so add it empty and fill it later.

<div id="msg" aria-live="polite"></div>

Change Text, Not the Region

Announce by updating the text content inside the existing region. Swapping the whole region out can make the announcement silently fail.

document.getElementById('msg').textContent = 'Saved';

Assertive Can Pile Up

Fire several assertive updates fast and they fight each other, interrupting and talking over the last one. Polite queues them in order instead.

Match Urgency to Impact

Pick the level by asking how much an interruption helps. Most updates: polite. Errors and warnings the user must act on: assertive.

Quick Check

You add a small confirmation that a list was sorted. Which politeness level fits best?

Recap: Choosing Urgency

You learned that polite waits and assertive interrupts. Default to polite, reserve assertive for true urgency, and keep the region in the DOM. ✅

Preguntas frecuentes

¿La lección «polite frente a assertive: elegir la urgencia» es gratis?

Sí — el texto completo de «polite frente a assertive: elegir la urgencia» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Web Accessibility Academy, actualiza a CoddyKit PRO. El curso de Web Accessibility Academy incluye 4 lecciones en total.

¿Qué aprenderé en «polite frente a assertive: elegir la urgencia»?

Decida si una actualización interrumpe al usuario. Practicas Web Accessibility Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar Web Accessibility Academy?

No se requiere experiencia previa. Web Accessibility Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.

¿Cuánto tiempo toma la lección «polite frente a assertive: elegir la urgencia»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de Web Accessibility Academy?

Sí. Cada lección de Web Accessibility Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. polite frente a assertive: elegir la urgencia
  2. Roles status, alert y log
  3. Anunciar toasts, cargadores y contadores
  4. Por qué fallan las regiones dinámicas y cómo corregirlas
← Volver a Web Accessibility Academy