jQuery removeClass() Method

jQuery removeClass() method removes one or more classes from selected elements.

If no class names are specified in the parameter then all classes will be removed from selected elements.


Here is a syntax for removeClass() method

$(selector).removeClass( className, function(index, currentclass) );
Parameter Type Description
className String Required. Add one or more space separated classes to be remove.
function(index,currentclass) Function Optional. A function that returns one or more class names to be remove.
  • index - Return the index position of the element in the set as an argument.
  • currentclass - Returns the current class name of the element in the set as an argument.


Here, in this example call removeClass() method

<!DOCTYPE html>
  <title>jQuery removeClass() method</title>
  <script src="jquery-latest.min.js"></script>
    $(document).ready(function() {
    <style type="text/css">
      .param {
        font: 16px Verdana, Arial;
        font-weight: bold;
        color: pink;
  <p class="param">First paragraph star here</p>
  <p class="param">Second paragraph star here</p>
  <button>Click here to call removeClass() method</button>

Run it...   »