Q:

jQuery Remove same Class on Multiple Id's

I am try to remove the same class on multiple ids
Here's the code:
var test = ['#step-1','#step-2','#step-3'];

$(test).removeClass('active-step');

This is not working, my question is..what's the problem or is there a better way of doing this?

A:

Try to frame that array as a multiple selector,
var test = ['#step-1','#step-2','#step-3'];
$(test.join()).removeClass('active-step');

As per the documentation, .join() will merge the elements of an array by using comma(,) if none supplied as its delimitter. So in our case, this signature would be useful in making a multiple selector.

separator : Optional. Specifies a string to separate each element of
  the array. The separator is converted to a string if necessary. If
  omitted, the array elements are separated with a comma. If separator
  is an empty string, all elements are joined without any characters in
  between them.

A:

This is the correct jQuery syntax to select multiple ids:
$('#step-1, #step-2, #step-3').removeClass('active-step');

A:

If you want to remove the classes of all elements whose id starts with step, then you can use starts ^ with attribute selector
$("[id^='step']").removeClass('active-step');

I thing your requirement is to remove the active calsses and add the active class to a particular element, then you can use like this too,
$(".active-step").removeClass('active-step');

