Description:

The Jquery removeClass() method remove the css class for the matchedย element.ย It will remove single/multiple classes for each element in the set of matched elements.

Note: The removeClass method will remove all css class names from the selected elements if no parameter is specified.

Syntax

$(selector).removeClass(classname,function(index,currentclass))

classNameย  Specifies one or more class name to remove for the selected element. More than one class will be give by “space” as separator.
function(index,currentclass) A function that returns one or more class names to remove
index : Returns the index position of the matched element
currentclass : Returns the current class name of the matched element

Example:ย 

Output:ย 

As per our code, ย on clicking of “Add CSS Class” button, it will add the “CustomClass” class to the div & if we click “Remove CSS Class” button, then it will remove “CustomClass” from the div ย using removeClass() method as shown below.

dotnet-helpers-com-jquery-removeclass-method-thiyagu-jquery-helpers