JQuery - find a specific class and delete it

I want to find a specific div with a .factive class and delete it to add it to another div.

Here is my current code:

$('.factive').removeClass('.factive'); 

I know that it finds the div that I want (checked through the Javascript Console), but it does not delete the class.

Any clues?

+6
source share
1 answer

Not there . in the name of the actual class, only in the selector.

 $('.factive').removeClass('factive'); 

This will effectively remove the factive class from all its elements.

+25
source

Source: https://habr.com/ru/post/974274/


All Articles