Browse - Programming Tips - How can I remove some class and add some class in one statement?

Date: 2017apr21
Language: javaScript
Library: jQuery

Q.  How can I remove some class and add some class in one statement?

A.

$('#mything').removeClass('oldclass').addClass('newclass');
There is also toggleClass() that removes a class if its there and adds it if not there.