jQuery toggleClass()
The jQuery toggleClass() method adds or removes one or more classes of the selected element. If the class name is already added, toggleclass() method removes it and if the class name was removed earlier, it adds the class name, creating a toggle effect. Syntax: $(selector).toggleClass(classname,function(index,currentclass),switch) Classname: Classname is a compulsory parameter of the jQuery toggleClass() … Read more