getElementById method

Element? getElementById(
  1. Element parentElement,
  2. int targetId
)
inherited

Implementation

Element? getElementById(Element parentElement, int targetId) {
  Element? result;
  List childNodes = parentElement.childNodes;

  for (int i = 0; i < childNodes.length; i++) {
    Element element = childNodes[i];
    if (element.targetId == targetId) {
      result = element;
      break;
    }
  }
  return result;
}