select<T extends DOMNode> method

T? select<T extends DOMNode>(
  1. Object? selector
)

Returns a node T that matches selector.

selector can by a num, used as a node index.

Implementation

T? select<T extends DOMNode>(Object? selector) {
  if (selector == null || isEmptyContent) return null;

  if (selector is num) {
    return nodeByIndex(selector as int?);
  } else {
    return selectWhere(selector);
  }
}