Skip to content
Advertisement

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?

Advertisement

Answer

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement