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

152
Vistas
How to find index of array of class elements?

I have a list of svg objects with a certain class name 'test'.

list = document.getElementsByClassName('test')

I want to find the index of an object in the list (e.target) when it is clicked via an event listener. But it's freezing up.

The smallest example that gives an error would be the following:

list.indexOf(list[1])

which should return 1 but doesn't. I think the problem is that getElementsByClassName gives an "array-like" list, not an actual array. But I can't figure out how to get by it.

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