title: Add and remove multiple classes in jQuery
body: <p>I'm trying to add and remove multiple classes on a text field by clicking different radio buttons. I'm not able to remove the unwanted classes while switching between different radio buttons.</p>
  
  <p>My code for this is:</p>
  
  <pre><code>// For 1st radio button
  if (actionUrl == "search-client-by-id") {
      $("#req").removeClass("validate[required,custom[onlyLetterNumber],maxSize[20],custom[onlyLetterSp]]")
               .addClass("validate[required,custom[onlyNumberSp]]");
  }
  // For 2nd radio button
  else if (actionUrl == "search-client-by-name") {    
      $("#req").removeClass("validate[required,custom[onlyNumberSp]]")
               .addClass("validate[required,custom[onlyLetterNumber],maxSize[20],custom[onlyLetterSp]]");
  }
  </code></pre>