diff options
Diffstat (limited to 'src/html/dom.nim')
-rw-r--r-- | src/html/dom.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 6eb1079f..d09849c7 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2336,6 +2336,12 @@ func findAnchor*(document: Document; id: string): Element = return child return nil +func findAutoFocus*(document: Document): Element = + for child in document.elements: + if child.attrb(satAutofocus): + return child + return nil + # Forward declaration hack isDefaultPassive = func (eventTarget: EventTarget): bool = if eventTarget of Window: |