Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery - Find specific class and remove it

I want to find a specific div with the class .factive and remove it, to add it to another div.

Here is my current code:

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

I know it does find the div I want (checked via Javascript Console), but it doesn't remove the class.

Any clues?

like image 324
arteepa Avatar asked Aug 24 '14 19:08

arteepa


1 Answers

There's no . in the actual class name, only in the selector.

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

That will effectively remove the class factive from all elements that have it.

like image 91
plalx Avatar answered Oct 10 '22 20:10

plalx