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

271
Vistas
Uncaught SyntaxError: Unexpected identifier when using HTMLCollectionOf<HTMLElement>

This is the line that gives me the error:

var modalList = document.getElementsByClassName("modal") as HTMLCollectionOf<HTMLElement>;

This was based off a HowTo tutorial found here, but my page will have multiple modal images so I changed a few things. I found many examples of casting the return value of .getElementsByClassName to HTMLCollectionOf<HTMLElement>, which is necessary in my case since I will be accessing some of the properties later. If most other examples work, why won't this one? My script tag is at the bottom of the body.

about 4 years ago · Juan Pablo Isaza
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