Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Agregar etiqueta Aria a un enlace

tratando de hacer un sitio web accesible. Hay un botón de menú cerrado al que le falta una etiqueta Aria y estoy tratando de agregar uno usando JS.

Estoy usando la siguiente secuencia de comandos para apuntar al ID y agregar el atributo, pero mientras se carga la secuencia de comandos, la etiqueta aria no se agrega.

 <script> function addAriaLabel() { // Create an aria label attribute: const addAria = document.createAttribute("aria-label"); // Set the value of the aria-label attribute: addAria.value = "close button"; // Add the href attribute to an element: document.getElementById("cart-accessibility").setAttributeNode(addAria); } </script>

Como referencia, la ubicación del elemento es https://outletbrands.gr/shop-2 (el botón de cierre de filtros)

¿Qué estoy haciendo mal?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece que resolví el problema. Me faltaba el gatillo.

Adicional:

ventana.onload = addAriaLabel;

y ahora funciona correctamente.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!