getElementBySRC function

Element? getElementBySRC(
  1. String tag,
  2. String src
)

Selects an Element in DOM with tag and src.

Implementation

Element? getElementBySRC(String tag, String src) {
  if (src.isEmpty) return null;

  var values = [src];

  if (!src.startsWith('data:')) {
    var resolvedURL = resolveUri(src).toString();
    values.add(resolvedURL);
  }

  return getElementByValues(tag, getElementSRC, values);
}