selectByID<T extends DOMNode> method
Returns a node T
that has attribute id
.
Implementation
T? selectByID<T extends DOMNode>(String? id) {
if (id == null || id.isEmpty || isEmptyContent) return null;
if (id.startsWith('#')) id = id.substring(1);
return selectWhere((n) => n is DOMElement && n.id == id);
}