Java Code Examples for org.jsoup.nodes.Element#toggleClass()

The following examples show how to use org.jsoup.nodes.Element#toggleClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Elements.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 Toggle the class name on every matched element's {@code class} attribute.
 @param className class name to add if missing, or remove if present, from every element.
 @return this
 */
public Elements toggleClass(String className) {
    for (Element element : this) {
        element.toggleClass(className);
    }
    return this;
}
 
Example 2
Source File: Elements.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 Toggle the class name on every matched element's {@code class} attribute.
 @param className class name to add if missing, or remove if present, from every element.
 @return this
 */
public Elements toggleClass(String className) {
    for (Element element : this) {
        element.toggleClass(className);
    }
    return this;
}
 
Example 3
Source File: Elements.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 Toggle the class name on every matched element's {@code class} attribute.
 @param className class name to add if missing, or remove if present, from every element.
 @return this
 */
public Elements toggleClass(String className) {
    for (Element element : this) {
        element.toggleClass(className);
    }
    return this;
}
 
Example 4
Source File: Elements.java    From jsoup-learning with MIT License 5 votes vote down vote up
/**
 Toggle the class name on every matched element's {@code class} attribute.
 @param className class name to add if missing, or remove if present, from every element.
 @return this
 */
public Elements toggleClass(String className) {
    for (Element element : contents) {
        element.toggleClass(className);
    }
    return this;
}