Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

0

Use querySelectorAll

target.querySelectorAll('th.numerical')

I also suggest you read up on selectors

about 4 years ago · Juan Pablo Isaza Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda