Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
45
rated 0 times [  46] [ 1]  / answers: 1 / hits: 37242  / 10 Years ago, sun, august 24, 2014, 12:00:00

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?


More From » jquery

 Answers
1

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.


[#69672] Thursday, August 21, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
finn

Total Points: 154
Total Questions: 88
Total Answers: 82

Location: Lithuania
Member since Mon, Nov 16, 2020
4 Years ago
;