getElementAttribute function

String? getElementAttribute(
  1. Element element,
  2. Object? key
)

Returns element attribute with key.

key Can be a RegExp or a String.

Implementation

String? getElementAttribute(Element element, Object? key) {
  if (key == null) return null;

  if (key is RegExp) {
    return getElementAttributeRegExp(element, key);
  } else {
    return getElementAttributeStr(element, key.toString());
  }
}