How to remove CSS class from multiple ID elements using JS?

I have a code that removes a class from ID in a certain condition, now I have more ID's that needs the same, how can I do it in an easy short way?

instead:

$("#id-1").removeClass("otout");
$("#id-2").removeClass("otout");
$("#id-3").removeClass("otout");
$("#id-4").removeClass("otout");

Something like this:

$("id-1, id-2, id-3, id-4").removeClass("otout");

Any chance it is possible?

#javascript #jquery #css

5 Likes2.20 GEEK