I don’t think it’s possible to edit the class using jQuery, and you shouldn’t in any case, since all the styles you want to use should already be defined in your stylesheet. You do not want to edit both JS files and CSS files to subsequently change your styles.
But if you absolutely need to, or if it is less of a style change than the behavior of the user interface (for example, you want to hide all elements of the class .warning, then you can just do something like:
$(".warning").css('display', 'none');
However, in addition to hiding / showing the elements, you just want to simply change the class of the element using addClass()/ removeClass()/ toggleClass(), as others have mentioned.
source
share