Removes a class from an HTMLElement.
.remove() method. The only difference is that this function returns the HTMLElement and thus allows chaining other functions for neater and/or more compact code.Simple example:
let foo = document.getElementById('foo'); foo.removeClass('bar');
Chaining allows for very compact code:
document.getElementById('foo').removeClass('bar').attr('data-value', '123');
… and also allows to write very neat and readable code:
document.getElementById('foo') .removeClass('bar') .attr('data-value', '123') ;