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

319
Visualizações
Post processing elements after a remove() using a function is not working

I am removing a cloned element using remove()

I have some post removal processing to do on any remaining clones and I need to ensure that the element has left the dom before I do this. I have attempted the following:

$('#something').remove(function() {
    ... stuff to do after the remove is complete...
})

However the '... stuff to do after the remove is complete...' never fires. Is this the best way to ensure an element is removed before post processing and if so what am I doing wrong?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

According to the doc, the remove function don't take a callback as parameter.

This is a synchronous function, so, you only have to execute your code on a new line.

$('.selector').remove();
console.log( $('.selector').length );

https://api.jquery.com/remove/

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