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

188
Vistas
How to get particular element with a className?

I am using target.getElementsByClassName('numerical')) to get the list of elements with classname of numerical . I want to further filter only th from the list. How can i do that?

0: th.ant-table-cell.numerical
1: th.ant-table-cell.numerical
2: td.ant-table-cell.numerical
3: td.ant-table-cell.numerical
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

Use querySelectorAll

target.querySelectorAll('th.numerical')

I also suggest you read up on selectors

about 4 years ago · Juan Pablo Isaza Denunciar

0

Well you can use querySelectorAll

target.querySelectorAll('th.numerical'))

This will give you all th elements with className of 'numerical'.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can create an array from element you get with getElementsByClassName and filter them like this

Array.from(target.getElementsByClassName('numerical'))
    .filter((tag) => {
        return tag.tagName === "TH");
    });

Here I use Array.from function to convert the result of getElementsByClassName to Array as it is an instance of HTMLCollection which is not iterable.

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