VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-removeclass-method/

⇱ jQuery removeClass() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery removeClass() Method

Last Updated : 11 Jul, 2025

The removeClass() method is an inbuilt method in jQuery that is used to remove one or more class names from the selected element.

Syntax:

$(selector).removeClass(class_name, function(index, current_class_name))

Parameters: This function accepts two parameters as mentioned above and described below:

  • class_name: It is an optional parameter that is used to specify the class name (one or more class) to remove. Multiple class names are separated with space.
  • function: It is an optional parameter and it returns one or more class names that need to be removed.
    • index: This parameter is used to return the index of the element.
    • current_class_name: This parameter returns the class name of selected elements.

Return Value: This method returns the selected element with the specified removed class name.

The below examples illustrate the removeClass() method in jQuery:

Example 1:

Output:

👁 jquery-26


Example 2: This example does not contain a parameter. This will remove all classes for the selected element.

Output:

👁 jquery-27


Related Articles:

Comment
Article Tags:

Explore