Document interface
在浏览器中加载的任何网页,并作为网页内容的入口点,即 DOM 树。
- 扩展
-
Node,DocumentAndElementEventHandlers,DocumentOrShadowRoot,FontFaceSource,GlobalEventHandlers,NonElementParentNode,ParentNode,XPathEvaluatorBase
属性
alink |
设置或获取文档中所有活动链接的颜色。 |
all | 返回对对象所包含的元素集合的引用。 |
anchors | 检索具有名称和/或 ID 属性的所有对象的集合。 此集合中的对象按 HTML 源顺序排列。 |
applets | 检索文档中所有小程序对象的集合。 |
bg |
荒废的。 设置或检索一个值,该值指示对象背后的背景色。 |
body | 指定文档正文的开头和结尾。 |
character |
返回文档的编码。 |
charset | 获取或设置用于对对象进行编码的字符集。 |
compat |
获取一个值,该值指示是否为对象打开符合标准的模式。 |
content |
返回文档的内容类型。 |
cookie | 返回应用于文档的 HTTP Cookie。 如果没有 Cookie 或 Cookie 无法应用于此资源,将返回空字符串。 可以设置,将新 Cookie 添加到元素的 HTTP Cookie 集。 如果内容被沙盒化为唯一的源(例如,在具有沙盒属性的 iframe 中),则会在获取和设置时引发“SecurityError”DOMException。 |
current |
返回脚本元素或 SVG 脚本元素,该元素当前正在执行,只要元素表示经典脚本。 对于重新进入脚本执行,返回最近开始执行尚未完成的脚本执行。 如果文档当前未执行脚本或 SVG 脚本元素(例如,因为正在运行的脚本是事件处理程序或超时),或者当前正在执行的脚本或 SVG 脚本元素表示模块脚本,则返回 null。 |
default |
返回活动文档的 Window 对象。 |
design |
设置或获取一个值,该值指示是否可以编辑文档。 |
dir | 设置或检索一个值,该值指示对象的读取顺序。 |
doctype | 获取一个对象,该对象表示与当前文档关联的文档类型声明。 |
document |
获取对文档根节点的引用。 |
documentURI | 返回文档的 URL。 |
___domain | 设置或获取文档的安全域。 |
embeds | 检索文档中所有嵌入对象的集合。 |
fg |
设置或获取文档的前景(文本)颜色。 |
forms | 检索文档中所有窗体对象的集合(以源顺序排列)。 |
fullscreen | |
fullscreen |
如果文档能够显示全屏和全屏显示元素,则返回 true;否则返回 false。 |
head | 返回 head 元素。 |
hidden | |
images | 检索文档中 img 对象的集合(按源顺序)。 |
implementation | 获取当前文档的实现对象。 |
input |
返回用于创建加载到文档对象的网页的字符编码。 |
last |
获取上次修改页面的日期(如果页面提供一个)。 |
link |
设置或获取文档链接的颜色。 |
links | 检索指定 href 属性和文档中所有区域对象的所有对象的集合。 |
___location | 包含有关当前 URL 的信息。 |
moz |
|
ms |
|
onfullscreenchange | |
onfullscreenerror | |
onpointerlockchange | |
onpointerlockerror | |
onreadystatechange | 对象状态发生更改时触发。 |
onvisibilitychange | |
owner |
|
picture |
|
plugins | 返回文档中嵌入元素的 HTMLCollection。 |
ready |
检索一个值,该值指示对象的当前状态。 |
referrer | 获取将用户引用到当前页的位置的 URL。 |
root |
|
scripts | 检索文档中所有脚本对象的集合。 |
scrolling |
|
timeline | |
title | 包含文档的标题。 |
URL | 设置或获取当前文档的 URL。 |
visibility |
|
vlink |
设置或获取用户访问的链接的颜色。 |
webkit |
继承属性
方法
继承的方法
属性详细信息
alinkColor
警告
现已弃用此 API。
设置或获取文档中所有活动链接的颜色。
alinkColor: string
属性值
string
all
警告
现已弃用此 API。
返回对对象所包含的元素集合的引用。
all: HTMLAllCollection
属性值
HTMLAllCollection
anchors
警告
现已弃用此 API。
检索具有名称和/或 ID 属性的所有对象的集合。 此集合中的对象按 HTML 源顺序排列。
anchors: HTMLCollectionOf<HTMLAnchorElement>
属性值
HTMLCollectionOf<HTMLAnchorElement>
applets
警告
现已弃用此 API。
检索文档中所有小程序对象的集合。
applets: HTMLCollection
属性值
HTMLCollection
bgColor
警告
现已弃用此 API。
荒废的。 设置或检索一个值,该值指示对象背后的背景色。
bgColor: string
属性值
string
body
指定文档正文的开头和结尾。
body: HTMLElement
属性值
HTMLElement
characterSet
返回文档的编码。
characterSet: string
属性值
string
charset
警告
现已弃用此 API。
This is a legacy alias of characterSet
.
获取或设置用于对对象进行编码的字符集。
charset: string
属性值
string
compatMode
获取一个值,该值指示是否为对象打开符合标准的模式。
compatMode: string
属性值
string
contentType
返回文档的内容类型。
contentType: string
属性值
string
cookie
返回应用于文档的 HTTP Cookie。 如果没有 Cookie 或 Cookie 无法应用于此资源,将返回空字符串。
可以设置,将新 Cookie 添加到元素的 HTTP Cookie 集。
如果内容被沙盒化为唯一的源(例如,在具有沙盒属性的 iframe 中),则会在获取和设置时引发“SecurityError”DOMException。
cookie: string
属性值
string
currentScript
返回脚本元素或 SVG 脚本元素,该元素当前正在执行,只要元素表示经典脚本。 对于重新进入脚本执行,返回最近开始执行尚未完成的脚本执行。
如果文档当前未执行脚本或 SVG 脚本元素(例如,因为正在运行的脚本是事件处理程序或超时),或者当前正在执行的脚本或 SVG 脚本元素表示模块脚本,则返回 null。
currentScript: null | HTMLOrSVGScriptElement
属性值
null | HTMLOrSVGScriptElement
defaultView
返回活动文档的 Window 对象。
defaultView: null | (Window & typeof globalThis)
属性值
null | (Window & typeof globalThis)
designMode
设置或获取一个值,该值指示是否可以编辑文档。
designMode: string
属性值
string
dir
设置或检索一个值,该值指示对象的读取顺序。
dir: string
属性值
string
doctype
获取一个对象,该对象表示与当前文档关联的文档类型声明。
doctype: null | DocumentType
属性值
null | DocumentType
documentElement
获取对文档根节点的引用。
documentElement: HTMLElement
属性值
HTMLElement
documentURI
返回文档的 URL。
documentURI: string
属性值
string
___domain
警告
现已弃用此 API。
设置或获取文档的安全域。
___domain: string
属性值
string
embeds
检索文档中所有嵌入对象的集合。
embeds: HTMLCollectionOf<HTMLEmbedElement>
属性值
HTMLCollectionOf<HTMLEmbedElement>
fgColor
警告
现已弃用此 API。
设置或获取文档的前景(文本)颜色。
fgColor: string
属性值
string
forms
检索文档中所有窗体对象的集合(以源顺序排列)。
forms: HTMLCollectionOf<HTMLFormElement>
属性值
HTMLCollectionOf<HTMLFormElement>
fullscreen
警告
现已弃用此 API。
fullscreen: boolean
属性值
boolean
fullscreenEnabled
如果文档能够显示全屏和全屏显示元素,则返回 true;否则返回 false。
fullscreenEnabled: boolean
属性值
boolean
head
返回 head 元素。
head: HTMLHeadElement
属性值
HTMLHeadElement
hidden
hidden: boolean
属性值
boolean
images
检索文档中 img 对象的集合(按源顺序)。
images: HTMLCollectionOf<HTMLImageElement>
属性值
HTMLCollectionOf<HTMLImageElement>
implementation
获取当前文档的实现对象。
implementation: DOMImplementation
属性值
DOMImplementation
inputEncoding
警告
现已弃用此 API。
This is a legacy alias of characterSet
.
返回用于创建加载到文档对象的网页的字符编码。
inputEncoding: string
属性值
string
lastModified
获取上次修改页面的日期(如果页面提供一个)。
lastModified: string
属性值
string
linkColor
警告
现已弃用此 API。
设置或获取文档链接的颜色。
linkColor: string
属性值
string
links
检索指定 href 属性和文档中所有区域对象的所有对象的集合。
links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
属性值
HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
___location
包含有关当前 URL 的信息。
Location ___location
属性值
Location
mozCancelFullScreen
mozCancelFullScreen: any
属性值
any
msExitFullscreen
msExitFullscreen: any
属性值
any
onfullscreenchange
onfullscreenchange: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
onfullscreenerror
onfullscreenerror: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
onpointerlockchange
onpointerlockchange: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
onpointerlockerror
onpointerlockerror: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
onreadystatechange
对象状态发生更改时触发。
onreadystatechange: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
onvisibilitychange
onvisibilitychange: null | (this: Document, ev: Event) => any
属性值
null | (this: Document, ev: Event) => any
ownerDocument
ownerDocument: null
属性值
null
pictureInPictureEnabled
pictureInPictureEnabled: boolean
属性值
boolean
plugins
返回文档中嵌入元素的 HTMLCollection。
plugins: HTMLCollectionOf<HTMLEmbedElement>
属性值
HTMLCollectionOf<HTMLEmbedElement>
readyState
检索一个值,该值指示对象的当前状态。
readyState: DocumentReadyState
属性值
DocumentReadyState
referrer
获取将用户引用到当前页的位置的 URL。
referrer: string
属性值
string
rootElement
警告
现已弃用此 API。
rootElement: null | SVGSVGElement
属性值
null | SVGSVGElement
scripts
检索文档中所有脚本对象的集合。
scripts: HTMLCollectionOf<HTMLScriptElement>
属性值
HTMLCollectionOf<HTMLScriptElement>
scrollingElement
scrollingElement: null | Element
属性值
null | Element
timeline
timeline: DocumentTimeline
属性值
DocumentTimeline
title
包含文档的标题。
title: string
属性值
string
URL
设置或获取当前文档的 URL。
URL: string
属性值
string
visibilityState
visibilityState: DocumentVisibilityState
属性值
DocumentVisibilityState
vlinkColor
警告
现已弃用此 API。
设置或获取用户访问的链接的颜色。
vlinkColor: string
属性值
string
webkitExitFullscreen
webkitExitFullscreen: void
属性值
void
继承属性详细信息
activeElement
返回文档中最深的元素,其中或要路由到哪些关键事件。 大致而言,这是文档中重点元素。
出于此 API 的目的,当子浏览上下文聚焦时,其容器将集中在父浏览上下文中。 例如,如果用户将焦点移动到 iframe 中的文本控件,则 iframe 是 iframe 节点文档中 activeElement API 返回的元素。
同样,当焦点元素位于与 documentOrShadowRoot 不同的节点树中时,返回的元素将是与 documentOrShadowRoot 位于同一节点树中的主机(如果 documentOrShadowRoot 是包含包含焦点元素的独占上级),如果不是,则返回的元素将为 null。
activeElement: null | Element
属性值
null | Element
继承自 DocumentOrShadowRoot.activeElement
adoptedStyleSheets
adoptedStyleSheets: CSSStyleSheet[]
属性值
CSSStyleSheet[]
继承自 DocumentOrShadowRoot.adoptedStyleSheets
ATTRIBUTE_NODE
ATTRIBUTE_NODE: number
属性值
number
继承自 Node.ATTRIBUTE_NODE 的
baseURI
返回节点的节点文档的文档基 URL。
baseURI: string
属性值
string
继承自 Node.baseURI
CDATA_SECTION_NODE
节点是 CDATASection 节点。
CDATA_SECTION_NODE: number
属性值
number
继承自 Node.CDATA_SECTION_NODE 的
childElementCount
childElementCount: number
属性值
number
继承自 ParentNode.childElementCount
childNodes
返回子级。
childNodes: NodeListOf<ChildNode>
属性值
NodeListOf<ChildNode>
继承自 Node.childNodes
children
返回子元素。
children: HTMLCollection
属性值
HTMLCollection
继承自 ParentNode.children
COMMENT_NODE
节点是注释节点。
COMMENT_NODE: number
属性值
number
继承自 Node.COMMENT_NODE 的
DOCUMENT_FRAGMENT_NODE
节点是 DocumentFragment 节点。
DOCUMENT_FRAGMENT_NODE: number
属性值
number
继承自 Node.DOCUMENT_FRAGMENT_NODE 的
DOCUMENT_NODE
节点是文档。
DOCUMENT_NODE: number
属性值
number
继承自 Node.DOCUMENT_NODE 的
DOCUMENT_POSITION_CONTAINED_BY
当其他节点是节点的后代时设置。
DOCUMENT_POSITION_CONTAINED_BY: number
属性值
number
继承自 Node.DOCUMENT_POSITION_CONTAINED_BY 的
DOCUMENT_POSITION_CONTAINS
当其他节点是节点的上级时设置。
DOCUMENT_POSITION_CONTAINS: number
属性值
number
继承自 Node.DOCUMENT_POSITION_CONTAINS
DOCUMENT_POSITION_DISCONNECTED
当节点和其他节点不在同一树中时设置。
DOCUMENT_POSITION_DISCONNECTED: number
属性值
number
继承自 Node.DOCUMENT_POSITION_DISCONNECTED 的
DOCUMENT_POSITION_FOLLOWING
当其他节点位于以下节点时设置。
DOCUMENT_POSITION_FOLLOWING: number
属性值
number
继承自 Node.DOCUMENT_POSITION_FOLLOWING 的
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number
属性值
number
继承自 Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC 的
DOCUMENT_POSITION_PRECEDING
设置其他节点之前的节点。
DOCUMENT_POSITION_PRECEDING: number
属性值
number
继承自 Node.DOCUMENT_POSITION_PRECEDING 的
DOCUMENT_TYPE_NODE
node 是 doctype。
DOCUMENT_TYPE_NODE: number
属性值
number
继承自 Node.DOCUMENT_TYPE_NODE 的
ELEMENT_NODE
node 是一个元素。
ELEMENT_NODE: number
属性值
number
继承自 Node.ELEMENT_NODE 的
ENTITY_NODE
ENTITY_NODE: number
属性值
number
继承自 Node.ENTITY_NODE 的
ENTITY_REFERENCE_NODE
ENTITY_REFERENCE_NODE: number
属性值
number
继承自 Node.ENTITY_REFERENCE_NODE 的
firstChild
返回第一个子级。
firstChild: null | ChildNode
属性值
null | ChildNode
继承自 Node.firstChild
firstElementChild
返回作为元素的第一个子级,否则返回 null。
firstElementChild: null | Element
属性值
null | Element
继承自 ParentNode.firstElementChild
fonts
fonts: FontFaceSet
属性值
FontFaceSet
继承自 FontFaceSource.fonts
fullscreenElement
返回文档的全屏元素。
fullscreenElement: null | Element
属性值
null | Element
继承自 DocumentOrShadowRoot.fullscreenElement
isConnected
如果节点已连接,则返回 true;否则返回 false。
isConnected: boolean
属性值
boolean
继承自 Node.isConnected
lastChild
返回最后一个子级。
lastChild: null | ChildNode
属性值
null | ChildNode
继承自 Node.lastChild
lastElementChild
返回作为元素的最后一个子级,否则返回 null。
lastElementChild: null | Element
属性值
null | Element
继承自 ParentNode.lastElementChild
nextSibling
返回下一个同级。
nextSibling: null | ChildNode
属性值
null | ChildNode
继承自 Node.nextSibling
nodeName
返回适用于节点类型的字符串。
nodeName: string
属性值
string
继承自 Node.nodeName
nodeType
返回节点的类型。
nodeType: number
属性值
number
继承自 Node.nodeType
nodeValue
nodeValue: null | string
属性值
null | string
继承自 Node.nodeValue
NOTATION_NODE
NOTATION_NODE: number
属性值
number
继承自 Node.NOTATION_NODE 的
onabort
当用户中止下载时触发。
onabort: null | (this: GlobalEventHandlers, ev: UIEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: UIEvent) => any
继承自 GlobalEventHandlers.onabort
onanimationcancel
onanimationcancel: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
继承自 GlobalEventHandlers.onanimationcancel
onanimationend
onanimationend: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
继承自 GlobalEventHandlers.onanimationend
onanimationiteration
onanimationiteration: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
继承自 GlobalEventHandlers.onanimationiteration
onanimationstart
onanimationstart: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: AnimationEvent) => any
继承自 GlobalEventHandlers.onanimationstart
onauxclick
onauxclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onauxclick
onbeforeinput
onbeforeinput: null | (this: GlobalEventHandlers, ev: InputEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: InputEvent) => any
继承自 GlobalEventHandlers.onbeforeinput
onblur
当对象失去输入焦点时触发。
onblur: null | (this: GlobalEventHandlers, ev: FocusEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: FocusEvent) => any
继承自 GlobalEventHandlers.onblur
oncancel
oncancel: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 globalEventHandlers.oncancel 的
oncanplay
在可能播放时发生,但需要进一步缓冲。
oncanplay: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.oncanplay
oncanplaythrough
oncanplaythrough: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.oncanplaythrough
onchange
当对象或所选内容发生更改时触发。
onchange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onchange
onclick
当用户单击对象上的鼠标左键时触发
onclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onclick
onclose
onclose: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onclose
oncontextmenu
当用户在工作区中单击鼠标右键时触发,打开上下文菜单。
oncontextmenu: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.oncontextmenu
oncopy
oncopy: null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
属性值
null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
继承自 DocumentAndElementEventHandlers.oncopy
oncuechange
oncuechange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.oncuechange
oncut
oncut: null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
属性值
null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
继承自 DocumentAndElementEventHandlers.oncut
ondblclick
当用户双击对象时触发。
ondblclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.ondblclick
ondrag
在拖动操作期间持续触发源对象。
ondrag: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondrag
ondragend
当用户在拖动操作关闭时释放鼠标时,会触发源对象。
ondragend: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondragend
ondragenter
当用户将对象拖动到有效的放置目标时,将触发目标元素。
ondragenter: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondragenter
ondragleave
当用户在拖动操作期间将鼠标移出有效放置目标时,会触发目标对象。
ondragleave: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondragleave
ondragover
当用户将对象拖动到有效的放置目标上时,会持续触发目标元素。
ondragover: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondragover
ondragstart
当用户开始拖动文本选择或所选对象时,将触发源对象。
ondragstart: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondragstart
ondrop
ondrop: null | (this: GlobalEventHandlers, ev: DragEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: DragEvent) => any
继承自 GlobalEventHandlers.ondrop
ondurationchange
在更新持续时间属性时发生。
ondurationchange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.ondurationchange
onemptied
当媒体元素重置为其初始状态时发生。
onemptied: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onemptied
onended
到达播放结束时发生。
onended: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onended
onerror
在对象加载期间发生错误时触发。
onerror: OnErrorEventHandler
属性值
OnErrorEventHandler
继承自 GlobalEventHandlers.onerror
onfocus
当对象收到焦点时触发。
onfocus: null | (this: GlobalEventHandlers, ev: FocusEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: FocusEvent) => any
继承自 GlobalEventHandlers.onfocus
onformdata
onformdata: null | (this: GlobalEventHandlers, ev: FormDataEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: FormDataEvent) => any
继承自 GlobalEventHandlers.onformdata
ongotpointercapture
ongotpointercapture: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.ongotpointercapture
oninput
oninput: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.oninput
oninvalid
oninvalid: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.oninvalid
onkeydown
当用户按下键时触发。
onkeydown: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
继承自 GlobalEventHandlers.onkeydown
onkeypress
警告
现已弃用此 API。
当用户按下字母数字键时触发。
onkeypress: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
继承自 GlobalEventHandlers.onkeypress 的
onkeyup
当用户释放密钥时触发。
onkeyup: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any
继承自 GlobalEventHandlers.onkeyup
onload
在浏览器加载对象后立即触发。
onload: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onload
onloadeddata
在当前播放位置加载媒体数据时发生。
onloadeddata: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onloadeddata
onloadedmetadata
在确定媒体的持续时间和维度时发生。
onloadedmetadata: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onloadedmetadata
onloadstart
当 Internet Explorer 开始查找媒体数据时发生。
onloadstart: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onloadstart
onlostpointercapture
onlostpointercapture: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onlostpointercapture
onmousedown
当用户使用任一鼠标按钮单击对象时触发。
onmousedown: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmousedown
onmouseenter
onmouseenter: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmouseenter
onmouseleave
onmouseleave: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmouseleave
onmousemove
当用户将鼠标移到对象上时触发。
onmousemove: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmousemove
onmouseout
当用户将鼠标指针移到对象的边界之外时触发。
onmouseout: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmouseout
onmouseover
当用户将鼠标指针移到对象中时触发。
onmouseover: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmouseover
onmouseup
当用户在鼠标悬停在对象上时释放鼠标按钮时触发。
onmouseup: null | (this: GlobalEventHandlers, ev: MouseEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: MouseEvent) => any
继承自 GlobalEventHandlers.onmouseup
onpaste
onpaste: null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
属性值
null | (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any
继承自 DocumentAndElementEventHandlers.onpaste
onpause
暂停播放时发生。
onpause: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onpause
onplay
请求 play 方法时发生。
onplay: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onplay
onplaying
当音频或视频开始播放时发生。
onplaying: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onplaying
onpointercancel
onpointercancel: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointercancel
onpointerdown
onpointerdown: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerdown
onpointerenter
onpointerenter: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerenter
onpointerleave
onpointerleave: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerleave
onpointermove
onpointermove: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointermove
onpointerout
onpointerout: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerout
onpointerover
onpointerover: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerover
onpointerup
onpointerup: null | (this: GlobalEventHandlers, ev: PointerEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: PointerEvent) => any
继承自 GlobalEventHandlers.onpointerup
onprogress
在下载媒体数据时发生指示进度。
onprogress: null | (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any
属性值
null | (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any
继承自 GlobalEventHandlers.onprogress
onratechange
当播放速率增加或减少时发生。
onratechange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onratechange
onreset
当用户重置窗体时触发。
onreset: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onreset
onresize
onresize: null | (this: GlobalEventHandlers, ev: UIEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: UIEvent) => any
继承自 GlobalEventHandlers.onresize
onscroll
当用户在对象的滚动条中重新定位滚动框时触发。
onscroll: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onscroll
onsecuritypolicyviolation
onsecuritypolicyviolation: null | (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any
继承自 GlobalEventHandlers.onsecuritypolicyviolation
onseeked
在搜寻操作结束时发生。
onseeked: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onseeked
onseeking
移动当前播放位置时发生。
onseeking: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onseeking
onselect
当当前所选内容更改时触发。
onselect: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onselect
onselectionchange
onselectionchange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onselectionchange
onselectstart
onselectstart: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onselectstart
onslotchange
onslotchange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onslotchange
onstalled
下载停止时发生。
onstalled: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onstalled
onsubmit
onsubmit: null | (this: GlobalEventHandlers, ev: SubmitEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: SubmitEvent) => any
继承自 GlobalEventHandlers.onsubmit
onsuspend
如果加载操作已有意停止,则发生此情况。
onsuspend: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onsuspend
ontimeupdate
发生以指示当前播放位置。
ontimeupdate: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.ontimeupdate
ontoggle
ontoggle: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onggle
ontouchcancel
ontouchcancel?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TouchEvent) => any
继承自 GlobalEventHandlers.ontouchcancel
ontouchend
ontouchend?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TouchEvent) => any
继承自 GlobalEventHandlers.ontouchend
ontouchmove
ontouchmove?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TouchEvent) => any
继承自 GlobalEventHandlers.ontouchmove
ontouchstart
ontouchstart?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TouchEvent) => any
继承自 GlobalEventHandlers.ontouchstart
ontransitioncancel
ontransitioncancel: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
继承自 GlobalEventHandlers.ontransitioncancel
ontransitionend
ontransitionend: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
继承自 GlobalEventHandlers.ontransitionend
ontransitionrun
ontransitionrun: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
继承自 GlobalEventHandlers.ontransitionrun
ontransitionstart
ontransitionstart: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: TransitionEvent) => any
继承自 GlobalEventHandlers.ontransitionstart
onvolumechange
更改音量或播放静音或取消静音时发生。
onvolumechange: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onvolumechange
onwaiting
播放停止时发生,因为视频资源的下一帧不可用。
onwaiting: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onwaiting
onwebkitanimationend
警告
现已弃用此 API。
This is a legacy alias of onanimationend
.
onwebkitanimationend: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onwebkitanimationend
onwebkitanimationiteration
警告
现已弃用此 API。
This is a legacy alias of onanimationiteration
.
onwebkitanimationiteration: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onwebkitanimationiteration
onwebkitanimationstart
警告
现已弃用此 API。
This is a legacy alias of onanimationstart
.
onwebkitanimationstart: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onwebkitanimationstart
onwebkittransitionend
警告
现已弃用此 API。
This is a legacy alias of ontransitionend
.
onwebkittransitionend: null | (this: GlobalEventHandlers, ev: Event) => any
属性值
null | (this: GlobalEventHandlers, ev: Event) => any
继承自 GlobalEventHandlers.onwebkittransitionend
onwheel
onwheel: null | (this: GlobalEventHandlers, ev: WheelEvent) => any
属性值
null | (this: GlobalEventHandlers, ev: WheelEvent) => any
继承自 GlobalEventHandlers.onwheel
parentElement
返回父元素。
parentElement: null | HTMLElement
属性值
null | HTMLElement
继承自 Node.parentElement
parentNode
返回父级。
parentNode: null | ParentNode
属性值
null | ParentNode
继承自 Node.parentNode
pictureInPictureElement
pictureInPictureElement: null | Element
属性值
null | Element
继承自 DocumentOrShadowRoot.pictureInPictureElement
pointerLockElement
pointerLockElement: null | Element
属性值
null | Element
继承自 DocumentOrShadowRoot.pointerLockElement
previousSibling
返回上一个同级。
previousSibling: null | ChildNode
属性值
null | ChildNode
继承自 Node.previousSibling
PROCESSING_INSTRUCTION_NODE
节点是 ProcessingInstruction 节点。
PROCESSING_INSTRUCTION_NODE: number
属性值
number
继承自 Node.PROCESSING_INSTRUCTION_NODE 的
styleSheets
检索表示样式表的样式表的集合,这些样式表对应于文档中链接或样式对象的每个实例。
styleSheets: StyleSheetList
属性值
StyleSheetList
继承自 DocumentOrShadowRoot.styleSheets
textContent
textContent: null | string
属性值
null | string
继承自 Node.textContent
TEXT_NODE
节点是文本节点。
TEXT_NODE: number
属性值
number
继承自 Node.TEXT_NODE 的
方法详细信息
addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)
function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions)
参数
- type
-
string
- listener
-
EventListenerOrEventListenerObject
- options
-
boolean | AddEventListenerOptions
addEventListener<K>(K, (this: Document, ev: DocumentEventMap[K]) => any, boolean | AddEventListenerOptions)
function addEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions)
参数
- type
-
K
- listener
-
(this: Document, ev: DocumentEventMap[K]) => any
- options
-
boolean | AddEventListenerOptions
adoptNode<T>(T)
从另一个文档移动节点并返回它。
如果节点是文档,则引发“NotSupportedError”DOMException;如果节点是阴影根,则引发“HierarchyRequestError”DOMException。
function adoptNode<T>(node: T): T
参数
- node
-
T
返回
T
captureEvents()
警告
现已弃用此 API。
function captureEvents()
caretRangeFromPoint(number, number)
警告
现已弃用此 API。
function caretRangeFromPoint(x: number, y: number): null | Range
参数
- x
-
number
- y
-
number
返回
null | Range
clear()
警告
现已弃用此 API。
function clear()
close()
关闭输出流并强制显示发送的数据。
function close()
createAttribute(string)
创建具有指定名称的属性对象。
function createAttribute(localName: string): Attr
参数
- localName
-
string
返回
Attr
createAttributeNS(null | string, string)
function createAttributeNS(namespace: null | string, qualifiedName: string): Attr
参数
- namespace
-
null | string
- qualifiedName
-
string
返回
Attr
createCDATASection(string)
返回数据为数据的 CDATASection 节点。
function createCDATASection(data: string): CDATASection
参数
- data
-
string
返回
CDATASection
createComment(string)
创建具有指定数据的注释对象。
function createComment(data: string): Comment
参数
- data
-
string
设置注释对象的数据。
返回
Comment
createDocumentFragment()
创建新文档。
function createDocumentFragment(): DocumentFragment
返回
DocumentFragment
createElement(string, ElementCreationOptions)
function createElement(tagName: string, options?: ElementCreationOptions): HTMLElement
参数
- tagName
-
string
- options
-
ElementCreationOptions
返回
HTMLElement
createElement<K>(K, ElementCreationOptions)
为指定的标记创建元素的实例。
function createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]
参数
- tagName
-
K
元素的名称。
- options
-
ElementCreationOptions
返回
HTMLElementTagNameMap[K]
createElement<K>(K, ElementCreationOptions)
警告
现已弃用此 API。
function createElement<K>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]
参数
- tagName
-
K
- options
-
ElementCreationOptions
返回
HTMLElementDeprecatedTagNameMap[K]
createElementNS("http://www.w3.org/1999/xhtml", string)
返回具有命名空间命名空间的元素。 其命名空间前缀将是 qualifiedName 或 null 中“:”(U+003E)之前的所有内容。 其本地名称将全部位于 qualifiedName 或 qualifiedName 中的“:”(U+003E)之后。
如果 localName 与 Name 生产不匹配,将引发“InvalidCharacterError”DOMException。
如果以下条件之一为 true,将引发“NamespaceError”DOMException:
localName 与 QName 生产不匹配。 Namespace前缀不为 null,命名空间为空字符串。 Namespace前缀为“xml”,命名空间不是 XML 命名空间。 qualifiedName 或命名空间前缀为“xmlns”,命名空间不是 XMLNS 命名空间。 namespace 是 XMLNS 命名空间,并且 qualifiedName 和命名空间前缀都不是“xmlns”。
提供后,可以使用选项来创建自定义的内置元素。
function createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement
参数
- namespaceURI
-
"http://www.w3.org/1999/xhtml"
- qualifiedName
-
string
返回
HTMLElement
createElementNS("http://www.w3.org/2000/svg", string)
function createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
参数
- namespaceURI
-
"http://www.w3.org/2000/svg"
- qualifiedName
-
string
返回
SVGElement
createElementNS(null | string, string, ElementCreationOptions)
function createElementNS(namespaceURI: null | string, qualifiedName: string, options?: ElementCreationOptions): Element
参数
- namespaceURI
-
null | string
- qualifiedName
-
string
- options
-
ElementCreationOptions
返回
Element
createElementNS(null | string, string, string | ElementCreationOptions)
function createElementNS(namespace: null | string, qualifiedName: string, options?: string | ElementCreationOptions): Element
参数
- namespace
-
null | string
- qualifiedName
-
string
- options
-
string | ElementCreationOptions
返回
Element
createElementNS<K>("http://www.w3.org/2000/svg", K)
function createElementNS<K>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]
参数
- namespaceURI
-
"http://www.w3.org/2000/svg"
- qualifiedName
-
K
返回
SVGElementTagNameMap[K]
createEvent("AnimationEvent")
function createEvent(eventInterface: "AnimationEvent"): AnimationEvent
参数
- eventInterface
-
"AnimationEvent"
返回
AnimationEvent
createEvent("AnimationPlaybackEvent")
function createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent
参数
- eventInterface
-
"AnimationPlaybackEvent"
返回
AnimationPlaybackEvent
createEvent("AudioProcessingEvent")
function createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent
参数
- eventInterface
-
"AudioProcessingEvent"
返回
AudioProcessingEvent
createEvent("BeforeUnloadEvent")
function createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent
参数
- eventInterface
-
"BeforeUnloadEvent"
返回
BeforeUnloadEvent
createEvent("BlobEvent")
function createEvent(eventInterface: "BlobEvent"): BlobEvent
参数
- eventInterface
-
"BlobEvent"
返回
BlobEvent
createEvent("ClipboardEvent")
function createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent
参数
- eventInterface
-
"ClipboardEvent"
返回
ClipboardEvent
createEvent("CloseEvent")
function createEvent(eventInterface: "CloseEvent"): CloseEvent
参数
- eventInterface
-
"CloseEvent"
返回
CloseEvent
createEvent("CompositionEvent")
function createEvent(eventInterface: "CompositionEvent"): CompositionEvent
参数
- eventInterface
-
"CompositionEvent"
返回
CompositionEvent
createEvent("CustomEvent")
function createEvent(eventInterface: "CustomEvent"): CustomEvent<any>
参数
- eventInterface
-
"CustomEvent"
返回
CustomEvent<any>
createEvent("DeviceMotionEvent")
function createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent
参数
- eventInterface
-
"DeviceMotionEvent"
返回
DeviceMotionEvent
createEvent("DeviceOrientationEvent")
function createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent
参数
- eventInterface
-
"DeviceOrientationEvent"
返回
DeviceOrientationEvent
createEvent("DragEvent")
function createEvent(eventInterface: "DragEvent"): DragEvent
参数
- eventInterface
-
"DragEvent"
返回
DragEvent
createEvent("ErrorEvent")
function createEvent(eventInterface: "ErrorEvent"): ErrorEvent
参数
- eventInterface
-
"ErrorEvent"
返回
ErrorEvent
createEvent("Event")
function createEvent(eventInterface: "Event"): Event
参数
- eventInterface
-
"Event"
返回
Event
createEvent("Events")
function createEvent(eventInterface: "Events"): Event
参数
- eventInterface
-
"Events"
返回
Event
createEvent("FocusEvent")
function createEvent(eventInterface: "FocusEvent"): FocusEvent
参数
- eventInterface
-
"FocusEvent"
返回
FocusEvent
createEvent("FontFaceSetLoadEvent")
function createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent
参数
- eventInterface
-
"FontFaceSetLoadEvent"
返回
FontFaceSetLoadEvent
createEvent("FormDataEvent")
function createEvent(eventInterface: "FormDataEvent"): FormDataEvent
参数
- eventInterface
-
"FormDataEvent"
返回
FormDataEvent
createEvent("GamepadEvent")
function createEvent(eventInterface: "GamepadEvent"): GamepadEvent
参数
- eventInterface
-
"GamepadEvent"
返回
GamepadEvent
createEvent("HashChangeEvent")
function createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent
参数
- eventInterface
-
"HashChangeEvent"
返回
HashChangeEvent
createEvent("IDBVersionChangeEvent")
function createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent
参数
- eventInterface
-
"IDBVersionChangeEvent"
返回
IDBVersionChangeEvent
createEvent("InputEvent")
function createEvent(eventInterface: "InputEvent"): InputEvent
参数
- eventInterface
-
"InputEvent"
返回
InputEvent
createEvent("KeyboardEvent")
function createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent
参数
- eventInterface
-
"KeyboardEvent"
返回
KeyboardEvent
createEvent("MediaEncryptedEvent")
function createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent
参数
- eventInterface
-
"MediaEncryptedEvent"
返回
MediaEncryptedEvent
createEvent("MediaKeyMessageEvent")
function createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent
参数
- eventInterface
-
"MediaKeyMessageEvent"
返回
MediaKeyMessageEvent
createEvent("MediaQueryListEvent")
function createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent
参数
- eventInterface
-
"MediaQueryListEvent"
返回
MediaQueryListEvent
createEvent("MediaStreamTrackEvent")
function createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent
参数
- eventInterface
-
"MediaStreamTrackEvent"
返回
MediaStreamTrackEvent
createEvent("MessageEvent")
function createEvent(eventInterface: "MessageEvent"): MessageEvent<any>
参数
- eventInterface
-
"MessageEvent"
返回
MessageEvent<any>
createEvent("MouseEvent")
function createEvent(eventInterface: "MouseEvent"): MouseEvent
参数
- eventInterface
-
"MouseEvent"
返回
MouseEvent
createEvent("MouseEvents")
function createEvent(eventInterface: "MouseEvents"): MouseEvent
参数
- eventInterface
-
"MouseEvents"
返回
MouseEvent
createEvent("MutationEvent")
function createEvent(eventInterface: "MutationEvent"): MutationEvent
参数
- eventInterface
-
"MutationEvent"
返回
MutationEvent
createEvent("MutationEvents")
function createEvent(eventInterface: "MutationEvents"): MutationEvent
参数
- eventInterface
-
"MutationEvents"
返回
MutationEvent
createEvent("OfflineAudioCompletionEvent")
function createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent
参数
- eventInterface
-
"OfflineAudioCompletionEvent"
返回
OfflineAudioCompletionEvent
createEvent("PageTransitionEvent")
function createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent
参数
- eventInterface
-
"PageTransitionEvent"
返回
PageTransitionEvent
createEvent("PaymentMethodChangeEvent")
function createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent
参数
- eventInterface
-
"PaymentMethodChangeEvent"
返回
PaymentMethodChangeEvent
createEvent("PaymentRequestUpdateEvent")
function createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent
参数
- eventInterface
-
"PaymentRequestUpdateEvent"
返回
PaymentRequestUpdateEvent
createEvent("PictureInPictureEvent")
function createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent
参数
- eventInterface
-
"PictureInPictureEvent"
返回
PictureInPictureEvent
createEvent("PointerEvent")
function createEvent(eventInterface: "PointerEvent"): PointerEvent
参数
- eventInterface
-
"PointerEvent"
返回
PointerEvent
createEvent("PopStateEvent")
function createEvent(eventInterface: "PopStateEvent"): PopStateEvent
参数
- eventInterface
-
"PopStateEvent"
返回
PopStateEvent
createEvent("ProgressEvent")
function createEvent(eventInterface: "ProgressEvent"): ProgressEvent<EventTarget>
参数
- eventInterface
-
"ProgressEvent"
返回
ProgressEvent<EventTarget>
createEvent("PromiseRejectionEvent")
function createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent
参数
- eventInterface
-
"PromiseRejectionEvent"
返回
PromiseRejectionEvent
createEvent("RTCDataChannelEvent")
function createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent
参数
- eventInterface
-
"RTCDataChannelEvent"
返回
RTCDataChannelEvent
createEvent("RTCDTMFToneChangeEvent")
function createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent
参数
- eventInterface
-
"RTCDTMFToneChangeEvent"
返回
RTCDTMFToneChangeEvent
createEvent("RTCErrorEvent")
function createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent
参数
- eventInterface
-
"RTCErrorEvent"
返回
RTCErrorEvent
createEvent("RTCPeerConnectionIceErrorEvent")
function createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent
参数
- eventInterface
-
"RTCPeerConnectionIceErrorEvent"
返回
RTCPeerConnectionIceErrorEvent
createEvent("RTCPeerConnectionIceEvent")
function createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent
参数
- eventInterface
-
"RTCPeerConnectionIceEvent"
返回
RTCPeerConnectionIceEvent
createEvent("RTCTrackEvent")
function createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent
参数
- eventInterface
-
"RTCTrackEvent"
返回
RTCTrackEvent
createEvent("SecurityPolicyViolationEvent")
function createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent
参数
- eventInterface
-
"SecurityPolicyViolationEvent"
返回
SecurityPolicyViolationEvent
createEvent("SpeechSynthesisErrorEvent")
function createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent
参数
- eventInterface
-
"SpeechSynthesisErrorEvent"
返回
SpeechSynthesisErrorEvent
createEvent("SpeechSynthesisEvent")
function createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent
参数
- eventInterface
-
"SpeechSynthesisEvent"
返回
SpeechSynthesisEvent
createEvent("StorageEvent")
function createEvent(eventInterface: "StorageEvent"): StorageEvent
参数
- eventInterface
-
"StorageEvent"
返回
StorageEvent
createEvent("SubmitEvent")
function createEvent(eventInterface: "SubmitEvent"): SubmitEvent
参数
- eventInterface
-
"SubmitEvent"
返回
SubmitEvent
createEvent("TouchEvent")
function createEvent(eventInterface: "TouchEvent"): TouchEvent
参数
- eventInterface
-
"TouchEvent"
返回
TouchEvent
createEvent("TrackEvent")
function createEvent(eventInterface: "TrackEvent"): TrackEvent
参数
- eventInterface
-
"TrackEvent"
返回
TrackEvent
createEvent("TransitionEvent")
function createEvent(eventInterface: "TransitionEvent"): TransitionEvent
参数
- eventInterface
-
"TransitionEvent"
返回
TransitionEvent
createEvent("UIEvent")
function createEvent(eventInterface: "UIEvent"): UIEvent
参数
- eventInterface
-
"UIEvent"
返回
UIEvent
createEvent("UIEvents")
function createEvent(eventInterface: "UIEvents"): UIEvent
参数
- eventInterface
-
"UIEvents"
返回
UIEvent
createEvent("WebGLContextEvent")
function createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent
参数
- eventInterface
-
"WebGLContextEvent"
返回
WebGLContextEvent
createEvent("WheelEvent")
function createEvent(eventInterface: "WheelEvent"): WheelEvent
参数
- eventInterface
-
"WheelEvent"
返回
WheelEvent
createEvent(string)
function createEvent(eventInterface: string): Event
参数
- eventInterface
-
string
返回
Event
createNodeIterator(Node, number, null | NodeFilter)
创建一个 NodeIterator 对象,该对象可用于遍历文档中已筛选的节点或元素列表。
function createNodeIterator(root: Node, whatToShow?: number, filter?: null | NodeFilter): NodeIterator
参数
- root
-
Node
要开始遍历的根元素或节点。
- whatToShow
-
number
要显示在节点列表中的节点或元素的类型
- filter
-
null | NodeFilter
要使用的自定义 NodeFilter 函数。 有关详细信息,请参阅筛选器。 不对筛选器使用 null。
返回
NodeIterator
createProcessingInstruction(string, string)
返回一个 ProcessingInstruction 节点,其目标是目标,数据是数据。 如果目标与名称生产不匹配,将引发“InvalidCharacterError”DOMException。 如果数据包含“?>将引发“InvalidCharacterError”DOMException。
function createProcessingInstruction(target: string, data: string): ProcessingInstruction
参数
- target
-
string
- data
-
string
返回
ProcessingInstruction
createRange()
返回一个空范围对象,该对象在其两个边界点都位于文档的开头。
function createRange(): Range
返回
Range
createTextNode(string)
从指定值创建文本字符串。
function createTextNode(data: string): Text
参数
- data
-
string
指定文本节点的 nodeValue 属性的字符串。
返回
Text
createTreeWalker(Node, number, null | NodeFilter)
创建一个 TreeWalker 对象,该对象可用于遍历文档中节点或元素的筛选列表。
function createTreeWalker(root: Node, whatToShow?: number, filter?: null | NodeFilter): TreeWalker
参数
- root
-
Node
要开始遍历的根元素或节点。
- whatToShow
-
number
要显示在节点列表中的节点或元素的类型。 有关详细信息,请参阅 whatToShow。
- filter
-
null | NodeFilter
要使用的自定义 NodeFilter 函数。
返回
TreeWalker
execCommand(string, boolean, string)
警告
现已弃用此 API。
对当前文档、当前选定内容或给定区域执行命令。
function execCommand(commandId: string, showUI?: boolean, value?: string): boolean
参数
- commandId
-
string
指定要执行的命令的字符串。 此命令可以是可在脚本中执行的任意命令标识符。
- showUI
-
boolean
显示用户界面,默认为 false。
- value
-
string
要分配的值。
返回
boolean
exitFullscreen()
停止文档的全屏元素显示全屏,并在完成后解析承诺。
function exitFullscreen(): Promise<void>
返回
Promise<void>
exitPictureInPicture()
function exitPictureInPicture(): Promise<void>
返回
Promise<void>
exitPointerLock()
function exitPointerLock()
getElementById(string)
返回对具有指定 ID 属性值的第一个对象的引用。
function getElementById(elementId: string): null | HTMLElement
参数
- elementId
-
string
指定 ID 值的字符串。
返回
null | HTMLElement
getElementsByClassName(string)
返回调用方法的对象(文档或元素)中具有 classNames 提供的所有类的元素的 HTMLCollection。 classNames 参数被解释为以空格分隔的类列表。
function getElementsByClassName(classNames: string): HTMLCollectionOf<Element>
参数
- classNames
-
string
返回
HTMLCollectionOf<Element>
getElementsByName(string)
根据 NAME 或 ID 属性的值获取对象的集合。
function getElementsByName(elementName: string): NodeListOf<HTMLElement>
参数
- elementName
-
string
根据 NAME 或 ID 属性的值获取对象的集合。
返回
NodeListOf<HTMLElement>
getElementsByTagName(string)
function getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>
参数
- qualifiedName
-
string
返回
HTMLCollectionOf<Element>
getElementsByTagName<K>(K)
根据指定的元素名称检索对象的集合。
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>
参数
- qualifiedName
-
K
返回
HTMLCollectionOf<HTMLElementTagNameMap[K]>
getElementsByTagName<K>(K)
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>
参数
- qualifiedName
-
K
返回
HTMLCollectionOf<SVGElementTagNameMap[K]>
getElementsByTagNameNS("http://www.w3.org/1999/xhtml", string)
如果命名空间和 localName 为“*”,则返回所有子代元素的 HTMLCollection。
如果只有命名空间为“*”,则返回其本地名称为 localName 的所有后代元素的 HTMLCollection。
如果只有 localName 为“*”,则返回命名空间为命名空间的所有后代元素的 HTMLCollection。
否则,返回命名空间为命名空间且本地名称为 localName 的所有后代元素的 HTMLCollection。
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>
参数
- namespaceURI
-
"http://www.w3.org/1999/xhtml"
- localName
-
string
返回
HTMLCollectionOf<HTMLElement>
getElementsByTagNameNS("http://www.w3.org/2000/svg", string)
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>
参数
- namespaceURI
-
"http://www.w3.org/2000/svg"
- localName
-
string
返回
HTMLCollectionOf<SVGElement>
getElementsByTagNameNS(null | string, string)
function getElementsByTagNameNS(namespace: null | string, localName: string): HTMLCollectionOf<Element>
参数
- namespace
-
null | string
- localName
-
string
返回
HTMLCollectionOf<Element>
getSelection()
返回一个对象,该对象表示加载到显示网页的对象中的文档的当前选择。
function getSelection(): null | Selection
返回
null | Selection
hasFocus()
获取一个值,该值指示对象当前是否具有焦点。
function hasFocus(): boolean
返回
boolean
hasStorageAccess()
function hasStorageAccess(): Promise<boolean>
返回
Promise<boolean>
importNode<T>(T, boolean)
返回节点的副本。 如果深度为 true,则副本还包括节点的后代。
如果节点是文档或阴影根,则引发“NotSupportedError”DOMException。
function importNode<T>(node: T, deep?: boolean): T
参数
- node
-
T
- deep
-
boolean
返回
T
open(string | URL, string, string)
function open(url: string | URL, name: string, features: string): null | Window
参数
- url
-
string | URL
- name
-
string
- features
-
string
返回
null | Window
open(string, string)
打开一个新窗口并加载由给定 URL 指定的文档。 此外,打开一个新窗口,该窗口使用 URL 参数和名称参数收集写入方法和 writeln 方法的输出。
function open(unused1?: string, unused2?: string): Document
参数
- unused1
-
string
- unused2
-
string
返回
Document
queryCommandEnabled(string)
警告
现已弃用此 API。
返回一个布尔值,该值指示在给定文档的当前状态的情况下,是否可以使用 execCommand 成功执行指定的命令。
function queryCommandEnabled(commandId: string): boolean
参数
- commandId
-
string
指定命令标识符。
返回
boolean
queryCommandIndeterm(string)
警告
现已弃用此 API。
返回一个布尔值,该值指示指定的命令是否处于不确定状态。
function queryCommandIndeterm(commandId: string): boolean
参数
- commandId
-
string
指定命令标识符的字符串。
返回
boolean
queryCommandState(string)
警告
现已弃用此 API。
返回一个布尔值,该值指示命令的当前状态。
function queryCommandState(commandId: string): boolean
参数
- commandId
-
string
指定命令标识符的字符串。
返回
boolean
queryCommandSupported(string)
警告
现已弃用此 API。
返回一个布尔值,该值指示当前范围是否支持当前命令。
function queryCommandSupported(commandId: string): boolean
参数
- commandId
-
string
指定命令标识符。
返回
boolean
queryCommandValue(string)
警告
现已弃用此 API。
返回给定命令的文档、范围或当前选定内容的当前值。
function queryCommandValue(commandId: string): string
参数
- commandId
-
string
指定命令标识符的字符串。
返回
string
releaseEvents()
警告
现已弃用此 API。
function releaseEvents()
removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)
function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions)
参数
- type
-
string
- listener
-
EventListenerOrEventListenerObject
- options
-
boolean | EventListenerOptions
removeEventListener<K>(K, (this: Document, ev: DocumentEventMap[K]) => any, boolean | EventListenerOptions)
function removeEventListener<K>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions)
参数
- type
-
K
- listener
-
(this: Document, ev: DocumentEventMap[K]) => any
- options
-
boolean | EventListenerOptions
requestStorageAccess()
function requestStorageAccess(): Promise<void>
返回
Promise<void>
write(string[])
将一个或多个 HTML 表达式写入指定窗口中的文档。
function write(text: string[])
参数
- text
-
string[]
writeln(string[])
将一个或多个 HTML 表达式(后跟回车)写入指定窗口中的文档。
function writeln(text: string[])
参数
- text
-
string[]
继承的方法详细信息
append((string | Node)[])
在节点的最后一个子级之后插入节点,同时将节点中的字符串替换为等效的文本节点。
如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。
function append(nodes: (string | Node)[])
参数
- nodes
-
(string | Node)[]
继承自 ParentNode.append
appendChild<T>(T)
function appendChild<T>(node: T): T
参数
- node
-
T
返回
T
继承自 Node.appendChild
cloneNode(boolean)
返回节点的副本。 如果深度为 true,则副本还包括节点的后代。
function cloneNode(deep?: boolean): Node
参数
- deep
-
boolean
返回
Node
继承自 Node.cloneNode
compareDocumentPosition(Node)
返回一个位掩码,指示相对于节点的其他位置。
function compareDocumentPosition(other: Node): number
参数
- other
-
Node
返回
number
继承自 Node.compareDocumentPosition
contains(null | Node)
如果另一个是节点的非独占后代,则返回 true;否则返回 false。
function contains(other: null | Node): boolean
参数
- other
-
null | Node
返回
boolean
继承自 Node.contains
createExpression(string, null | XPathNSResolver)
function createExpression(expression: string, resolver?: null | XPathNSResolver): XPathExpression
参数
- expression
-
string
- resolver
-
null | XPathNSResolver
返回
XPathExpression
继承自 XPathEvaluatorBase.createExpression
createNSResolver(Node)
function createNSResolver(nodeResolver: Node): XPathNSResolver
参数
- nodeResolver
-
Node
返回
XPathNSResolver
继承自 XPathEvaluatorBase.createNSResolver
dispatchEvent(Event)
如果事件的可取消属性值为 false 或其 preventDefault() 方法未调用,则调度合成事件事件的目标并返回 true;否则返回 false。
function dispatchEvent(event: Event): boolean
参数
- event
-
Event
返回
boolean
继承自 Node.dispatchEvent
elementFromPoint(number, number)
返回指定 x 坐标和指定 y 坐标的元素。
function elementFromPoint(x: number, y: number): null | Element
参数
- x
-
number
x 偏移量
- y
-
number
y 偏移量
返回
null | Element
继承自 DocumentOrShadowRoot.elementFromPoint
elementsFromPoint(number, number)
function elementsFromPoint(x: number, y: number): Element[]
参数
- x
-
number
- y
-
number
返回
Element[]
继承自 DocumentOrShadowRoot.elementsFromPoint
evaluate(string, Node, null | XPathNSResolver, number, null | XPathResult)
function evaluate(expression: string, contextNode: Node, resolver?: null | XPathNSResolver, type?: number, result?: null | XPathResult): XPathResult
参数
- expression
-
string
- contextNode
-
Node
- resolver
-
null | XPathNSResolver
- type
-
number
- result
-
null | XPathResult
返回
XPathResult
继承自 XPathEvaluatorBase.evaluate
getAnimations()
function getAnimations(): Animation[]
返回
Animation[]
继承自 DocumentOrShadowRoot.getAnimations
getRootNode(GetRootNodeOptions)
返回节点的根。
function getRootNode(options?: GetRootNodeOptions): Node
参数
- options
-
GetRootNodeOptions
返回
Node
继承自 Node.getRootNode
hasChildNodes()
返回节点是否具有子级。
function hasChildNodes(): boolean
返回
boolean
继承自 Node.hasChildNodes
insertBefore<T>(T, null | Node)
function insertBefore<T>(node: T, child: null | Node): T
参数
- node
-
T
- child
-
null | Node
返回
T
继承自 Node.insertBefore
isDefaultNamespace(null | string)
function isDefaultNamespace(namespace: null | string): boolean
参数
- namespace
-
null | string
返回
boolean
继承自 Node.isDefaultNamespace
isEqualNode(null | Node)
返回节点和其他Node 是否具有相同的属性。
function isEqualNode(otherNode: null | Node): boolean
参数
- otherNode
-
null | Node
返回
boolean
继承自 Node.isEqualNode
isSameNode(null | Node)
function isSameNode(otherNode: null | Node): boolean
参数
- otherNode
-
null | Node
返回
boolean
继承自 Node.isSameNode
lookupNamespaceURI(null | string)
function lookupNamespaceURI(prefix: null | string): null | string
参数
- prefix
-
null | string
返回
null | string
继承自 Node.lookupNamespaceURI
lookupPrefix(null | string)
function lookupPrefix(namespace: null | string): null | string
参数
- namespace
-
null | string
返回
null | string
继承自 Node.lookupPrefix
normalize()
删除空的独占文本节点,并将剩余连续独占文本节点的数据串联到其第一个节点中。
function normalize()
继承自 Node.normalize
prepend((string | Node)[])
在节点的第一个子级之前插入节点,同时将节点中的字符串替换为等效的文本节点。
如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。
function prepend(nodes: (string | Node)[])
参数
- nodes
-
(string | Node)[]
继承自 ParentNode.prepend
querySelector<E>(string)
function querySelector<E>(selectors: string): null | E
参数
- selectors
-
string
返回
null | E
继承自 ParentNode.querySelector
querySelector<K>(K)
返回与选择器匹配的节点后代的第一个元素。
function querySelector<K>(selectors: K): null | HTMLElementTagNameMap[K]
参数
- selectors
-
K
返回
null | HTMLElementTagNameMap[K]
继承自 ParentNode.querySelector
querySelector<K>(K)
function querySelector<K>(selectors: K): null | SVGElementTagNameMap[K]
参数
- selectors
-
K
返回
null | SVGElementTagNameMap[K]
继承自 ParentNode.querySelector
querySelectorAll<E>(string)
function querySelectorAll<E>(selectors: string): NodeListOf<E>
参数
- selectors
-
string
返回
NodeListOf<E>
继承自 ParentNode.querySelectorAll
querySelectorAll<K>(K)
返回与选择器匹配的节点的所有元素后代。
function querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>
参数
- selectors
-
K
返回
NodeListOf<HTMLElementTagNameMap[K]>
继承自 ParentNode.querySelectorAll
querySelectorAll<K>(K)
function querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>
参数
- selectors
-
K
返回
NodeListOf<SVGElementTagNameMap[K]>
继承自 ParentNode.querySelectorAll
removeChild<T>(T)
function removeChild<T>(child: T): T
参数
- child
-
T
返回
T
继承自 Node.removeChild
replaceChild<T>(Node, T)
function replaceChild<T>(node: Node, child: T): T
参数
- node
-
Node
- child
-
T
返回
T
继承自 Node.replaceChild
replaceChildren((string | Node)[])
将节点的所有子级替换为节点,同时将节点中的字符串替换为等效的文本节点。
如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。
function replaceChildren(nodes: (string | Node)[])
参数
- nodes
-
(string | Node)[]
继承自 ParentNode.replaceChildren