Why is this toggleclass not working? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
12th Feb 2018, 4:48 PM
Soubhagya Ranjan Mishra
Soubhagya Ranjan Mishra - avatar
7 Answers
+ 19
Wrong method name, there should be toggleClass, not Togglelass. JQuery is case-sensitive.
12th Feb 2018, 5:02 PM
NezhnyjVampir
+ 5
@NezhnyjVampir is almost right: you should write "toggleClass" intead of "Togglelass" (you miss the uppercase "C" and have a wrong uppercase "T" -- wich must be lowercase)... but that's not JQuery wich is case sensitive, but Javascript (JQuery is not a language, but a Javascript library/framework)... Fixed code: $(function() { $("button").click(function() { $("div").toggleClass ("Sou"); }); });
13th Feb 2018, 3:23 AM
visph
visph - avatar
+ 3
One problem is that you wrote “Togglelass” instead of “Toggleclass”, but still won’t work with that fixed.
12th Feb 2018, 4:58 PM
Jacob Pembleton
Jacob Pembleton - avatar
+ 1
I don't know why it is not working
12th Feb 2018, 5:00 PM
Soubhagya Ranjan Mishra
Soubhagya Ranjan Mishra - avatar
+ 1
They were working in the lessons
12th Feb 2018, 5:00 PM
Soubhagya Ranjan Mishra
Soubhagya Ranjan Mishra - avatar
+ 1
Thank you very much visph.And you also thanks @NezhnyjVampir.
14th Feb 2018, 12:02 PM
Soubhagya Ranjan Mishra
Soubhagya Ranjan Mishra - avatar
0
it's not working yet
13th Feb 2018, 2:43 AM
Soubhagya Ranjan Mishra
Soubhagya Ranjan Mishra - avatar