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

298
Views
How to remove elements which i find with find() jQuery?

I have an element in which i want to find a specific class and remove those class.

example

editingElm = `<p><span class="editing-target">hello</span><span class="editing-target">Welcome to this virtual world</span></p>`

 let elements = editingElm.find('.editing-target');// elements= [span,span] with the class
    editingElm.removeClass('editing-target');

How can i loop over the elements array and remove those classes i found?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Remove class from elements instead of editingElm

editingElm = `<p><span class="editing-target">hello</span><span class="editing-target">Welcome to this virtual world</span></p>`

let elements = editingElm.find('.editing-target');// elements= [span,span] with the class

elements.removeClass('editing-target');
about 4 years ago · Juan Pablo Isaza Report

0

Thanks to @Carsten Løvbo Andersen

You can't do editingElm.find('.editing-target') since based on your code, it's a string.
you have to do $(editingElm).find('.editing-target') and
editingElm = $(editingElm).find('.editing-target').removeClass("editing-target")

$(editingElm).find('.editing-target').removeClass("editing-target")
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!