Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!