code: public static void toggle(HTMLElement element, String css, boolean condition) {
          if (element != null) {
              if (condition) {
                  element.classList.add(css);
              } else {
                  element.classList.remove(css);
              }
          }
      }
docs: Adds the specified CSS class to the element if {@code condition} is {@code true}, removes it otherwise.