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

95
Visualizações
How to target classes with dynamically added classname in jQuery

I'm trying to use one piece of code to expand different content when different sections are clicked on. The way I'm trying to achieve this is by giving these tags a class name like class="counter_1", class= "conter_2"...and naming the subsequent content with numbers corresponding to the span class names. I've so far been able to name my span tags with jQuery:

$("span").each(function(i){
var $this = $(this);
$this.addClass("title" + (i+1));

});

but I'm not quite sure where to go from here. How do I target these dynamically added classes to have them expand the content I want to show?

Sorry if this description isn't so clear, I'm very new to jQuery :(

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