Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Accessibility of html elements that change innerHTML using Javascript

I have this number credibility counter on my site that as the user scrolls, the headings with numbers count upwards from zero to the final total. I think it's an eye-catching way of showing off credibility, but as far as accessibility goes, I don't know if dynamically changing the numbers with JavaScript will confuse people who use screen readers. I thought about adding an "aria-labeledby" attribute to the heading so that the screen reader will read that instead of the dynamically changing text, but all of my google searches say that headings don't need aria labels, because screen readers will read the text inside the heading tags.
My question is if I add an "aria-labeledby" attribute to the heading, will that mess up how screen readers read the element?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You normally don't need to do anything special. Given that JavaScript is supported in the user's browser, the text of the heading will also change dynamically for screen readers, too.

That dynamic change in content may be problematic for screen readers if it isn't reasonably expected. More especially, for example, when something currently being read is suddenly replaced by something else or completely deleted without user intervention. A common case of this is a carousel with content that changes every few seconds. Such carousels are usually bad for accessibility if they can't be easily stopped because of this reason among others.

However, in your case, for a simple counter, it's probably all right. There probably won't have much harm.

Attributes aria-label and aria-labelledby can only be used reliably with interactive elements that can be focusable. ON non-interactive elements, it isn't guaranteed to have them read on all platforms/browsers/screen readers. So, it's anyway not a good solution here.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda