Documentation
Preparing search index...
dom/query
findParentNode
Function findParentNode
findParentNode
(
node
:
HTMLElement
,
selector
:
string
,
stopNode
?:
string
|
HTMLElement
,
)
:
null
|
HTMLElement
向上递归查找父级元素,直到满足参数2的选择器条件的父元素
没有符合条件的父元素时,返回 null
Parameters
node
:
HTMLElement
需要查找的起点元素
selector
:
string
终点元素选择器
Optional
stopNode
:
string
|
HTMLElement
停止查找的元素, 用于在已知范围内查找时优化性能
Returns
null
|
HTMLElement
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Documentation
Loading...
向上递归查找父级元素,直到满足参数2的选择器条件的父元素