+ 1

How to remove added classes from anywhere

I have hada problem recently with classes assume i have an element named button in a variable btn now in a function named controller i add the css class using classlist.add,Now i wanna remove The css class i added in another different function classlist.remove(),If i Do this the css class isnt even being added at the first place but after i remove the classlist.remove The css class i added correctly,How can i remove added css classes from anywhere

15th Nov 2017, 6:15 PM
MohanPierce
MohanPierce - avatar
3 Answers
+ 2
In your remove(), specify which class you're removing. Post your code into Code Playground so we can see it if you're still having issues.
15th Nov 2017, 6:19 PM
AgentSmith
+ 2
yeah i have mentioned it already
16th Nov 2017, 2:28 AM
MohanPierce
MohanPierce - avatar
+ 2
https://code.sololearn.com/WoC6EMVtgG7i/?ref=app Hey heres the code,I have inserted comments so that U can identify where exactly i have done things,Look for a comment named ///****Questionpart***///Thats where My question relates Thank you!!!!
16th Nov 2017, 2:53 AM
MohanPierce
MohanPierce - avatar