selectByID method
Node
selectByID(
- String id,
- Node? target,
- Node? self,
- DOMTreeMap? treeMap,
- DOMContext? context,
override
Implementation
@override
Node selectByID(String id, Node? target, Node? self, DOMTreeMap? treeMap,
DOMContext? context) {
if (self is Element) {
var sel = _selectByID(self, id);
if (sel != null) return sel;
}
if (target is Element) {
var sel = _selectByID(target, id);
if (sel != null) return sel;
}
if (treeMap != null) {
var element = treeMap.rootElement;
if (element is Element) {
var sel = _selectByID(element, id);
if (sel != null) return sel;
}
}
var sel = document.querySelector('#$id');
sel ??= _selectByID(document.documentElement!, id);
return sel!;
}