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

176
Vistas
how to change `ari-label` description dynamically with javascript

how to change the value of 'ARIA-LABEL` according to user's precise language

getLang(element): void {
  let lang = element.document.getElementsByTagName('html')[0].getAttribute('lang');

  const labelAria = element.document.querySelector('[aria-label]');

  if(lang === 'en'){
   ?????
  }

}

Seeem give me some guidance I will be very grateful

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

0

I'm not sure what you mean by element.document but here is the correct way:

const labelAria = document.getElementById('element-id');

// set attribute
if(lang === 'en'){
   labelAria.setAttribute('aria-label', 'description here');
}

But if you really want to get the element by its aria label:

const labelAria = document.querySelector('div[aria-label="description here"]');

// set attribute
if(lang === 'en'){
   labelAria.setAttribute('aria-label', 'description 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