code: public static boolean hasAttribute(String url, String markup, String selector, String attributeName) {
          ensureMarkup(url, markup);
          Document document = documents.get(url);
          Elements elements = document.select(selector);
          return !elements.isEmpty() && elements.hasAttr(attributeName);
      }
docs: Checks if any of the elements matched by the {@code selector} contain the attribute {@code attributeName}. The {@code url} is used
  only for caching purposes, to avoid parsing multiple times the markup returned for the same resource.
  
  @param url            the url that identifies the markup
  @param markup         the markup
  @param selector       the selector used for retrieval
  @param attributeName  the attribute's name
  @return {@code true} if the attribute was found, {@code false} otherwise