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

141
Views
Jquery remove all inputs with same class except one

I want to remove all input labels with same class except one in div #tikersDiv. I got this script but it doesn't work:

  $('#tikersDiv').children('label').each(function(i){
  let removed = $('#id_' + (++i)).children('label').each(function(){
     $(this).remove();
  });
  $(this).append($(removed[0]).html());
  $(this).append($(removed[3]).html());
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ok, I've got this. If anybody want to remove all child elements with same class except one in div, just use this script. I hope I will help somebody

var classes = $('#tikersDiv label').map(function(){
    return $(this).attr('class');
    }).get();

$.each(classes, function(value, index){
     $('#tikersDiv').find('.' + index + ':not(:eq(0))').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!