public final void removeClass(final Element root, final String selector,
            final String className) {
        final Iterable<Element> elements; // Elements selected

        checkNotNull(root, "Received a null pointer as root element");
        checkNotNull(selector, "Received a null pointer as selector");
        checkNotNull(className, "Received a null pointer as className");

        // Selects and iterates over the elements
        elements = root.select(selector);
        for (final Element element : elements) {
            element.removeClass(className);

            if (element.classNames().isEmpty()) {
                element.removeAttr("class");
            }
        }
    }
public final void removeClass ( final Element root , final String selector , final String className ) { final Iterable < Element > elements ; checkNotNull ( root , "Received a null pointer as root element" ) ; checkNotNull ( selector , "Received a null pointer as selector" ) ; checkNotNull ( className , "Received a null pointer as className" ) ; elements = root . select ( selector ) ; for ( final Element element : elements ) { element . removeClass ( className ) ; if ( element . classNames ( ) . isEmpty ( ) ) { element . removeAttr ( "class" ) ; } } }
Finds a set of elements through a CSS selector and removes the received
class from them, if they have it.
<p>
If the elements end without classes then the class attribute is also
removed.

@param root
root element for the selection
@param selector
CSS selector for the elements with the class to remove
@param className
class to remove