Document interface
该 Document 接口表示浏览器中加载的任何网页,并用作网页内容的入口点,即 DOM 树。
- 扩展
-
Node,DocumentOrShadowRoot,FontFaceSource,GlobalEventHandlers,NonElementParentNode,ParentNode,XPathEvaluatorBase
属性
| alink |
返回或设置文档正文中活动链接的颜色。 |
| all | Document 接口的只读 |
| anchors |
|
| applets |
|
| bg |
已弃用 |
| body | 该 |
| character |
|
| charset | |
| compat |
|
| content |
|
| cookie | 使用 Document 属性 |
| current |
该 |
| default |
在浏览器中, |
| design |
|
| dir | 该 |
| doctype |
|
| document |
|
| documentURI |
|
| domain |
|
| embeds |
|
| fg |
|
| forms |
|
| fragment |
|
| fullscreen | 过时的文档界面 |
| fullscreen |
Document 接口上的只读 |
| head |
|
| hidden |
|
| images |
|
| implementation | 该 |
| input |
|
| last |
|
| link |
该 |
| links |
|
| location |
|
| moz |
|
| ms |
|
| onfullscreenchange | |
| onfullscreenerror | |
| onpointerlockchange | |
| onpointerlockerror | |
| onreadystatechange | |
| onvisibilitychange | |
| owner |
Node 接口的只读 |
| picture |
可用的只读 |
| plugins |
|
| ready |
该 |
| referrer | 该 |
| root |
|
| scripts |
|
| scrolling |
滚动 |
| text |
|
| timeline |
|
| title | 该 |
| URL |
|
| visibility |
|
| vlink |
该 |
| webkit |
继承属性
方法
继承的方法
| append((string | Node)[]) | 在节点的最后一个子级之后插入节点,同时将节点中的字符串替换为等效的文本节点。 如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。 |
| append |
|
| clone |
Node |
| compare |
Node |
| contains(Node | null) |
|
| create |
|
| create |
|
| dispatch |
|
| element |
|
| elements |
|
| evaluate(string, Node, XPath |
|
| get |
|
| get |
|
| has |
Node |
| insert |
Node |
| is |
|
| is |
|
| is |
Node |
| lookup |
Node |
| lookup |
Node |
| normalize() | Node |
| prepend((string | Node)[]) | 在节点的第一个子级之前插入节点,同时将节点中的字符串替换为等效的文本节点。 如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。 |
| query |
|
| query |
返回与选择器匹配的节点后代的第一个元素。 |
| query |
|
| query |
|
| query |
|
| query |
|
| query |
返回与选择器匹配的节点的所有元素后代。 |
| query |
|
| query |
|
| query |
|
| remove |
|
| replace |
|
| replace |
将节点的所有子级替换为节点,同时将节点中的字符串替换为等效的文本节点。 如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。 |
属性详细信息
alinkColor
all
Document 接口的只读 all 属性返回一个位于文档节点的 HTMLAllCollection。
all: HTMLAllCollection
属性值
HTMLAllCollection
anchors
anchors HTMLCollection 的只读属性。
anchors: HTMLCollectionOf<HTMLAnchorElement>
属性值
HTMLCollectionOf<HTMLAnchorElement>
applets
applets Document 的属性返回一个空的 HTMLCollection。
applets: HTMLCollection
属性值
HTMLCollection
bgColor
body
characterSet
charset
compatMode
contentType
cookie
currentScript
该 Document.currentScript 属性返回脚本元素,该脚本当前正在处理,并且不是 JavaScript 模块。
currentScript: HTMLOrSVGScriptElement | null
属性值
HTMLOrSVGScriptElement | null
defaultView
designMode
dir
doctype
doctype Document 接口的只读属性是一个 DocumentType 对象,表示与当前文档关联的 Doctype。
doctype: DocumentType | null
属性值
DocumentType | null
documentElement
documentElement Document 接口的只读属性返回示例 HTML 文档的 html 元素。
documentElement: HTMLElement
属性值
HTMLElement
documentURI
domain
embeds
embeds HTMLCollection 的只读属性。
embeds: HTMLCollectionOf<HTMLEmbedElement>
属性值
HTMLCollectionOf<HTMLEmbedElement>
fgColor
forms
forms Document 接口的只读属性返回一个 HTMLCollection,其中列出了文档中包含的所有窗体元素。
forms: HTMLCollectionOf<HTMLFormElement>
属性值
HTMLCollectionOf<HTMLFormElement>
fragmentDirective
fragmentDirective Document 接口的只读属性返回当前文档的 FragmentDirective。
fragmentDirective: FragmentDirective
属性值
FragmentDirective
fullscreen
过时的文档界面 fullscreen 的只读属性报告文档当前是否在全屏模式下显示内容。
fullscreen: boolean
属性值
boolean
fullscreenEnabled
head
hidden
images
images Document 接口的只读属性返回当前 HTML 文档中图像的集合。
images: HTMLCollectionOf<HTMLImageElement>
属性值
HTMLCollectionOf<HTMLImageElement>
implementation
该 Document.implementation 属性返回一个 DOMImplementation 对象。
implementation: DOMImplementation
属性值
DOMImplementation
inputEncoding
inputEncoding: string
属性值
string
lastModified
linkColor
links
links Document 接口的只读属性返回具有 href 属性值的文档中所有区域元素和元素的集合。
links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
属性值
HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>
location
mozCancelFullScreen
mozCancelFullScreen: any
属性值
any
msExitFullscreen
msExitFullscreen: any
属性值
any
onfullscreenchange
onfullscreenchange: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
onfullscreenerror
onfullscreenerror: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
onpointerlockchange
onpointerlockchange: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
onpointerlockerror
onpointerlockerror: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
onreadystatechange
onreadystatechange: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
onvisibilitychange
onvisibilitychange: (this: Document, ev: Event) => any | null
属性值
(this: Document, ev: Event) => any | null
ownerDocument
pictureInPictureEnabled
plugins
plugins包含一个或多个表示 HTMLCollection 的 HTMLEmbedElements 的只读属性。
plugins: HTMLCollectionOf<HTMLEmbedElement>
属性值
HTMLCollectionOf<HTMLEmbedElement>
readyState
referrer
rootElement
Document.rootElement 如果文档是文档,则返回作为文档根元素的元素。
rootElement: SVGSVGElement | null
属性值
SVGSVGElement | null
scripts
scripts Document 接口的属性返回文档中脚本元素的列表。
scripts: HTMLCollectionOf<HTMLScriptElement>
属性值
HTMLCollectionOf<HTMLScriptElement>
scrollingElement
textContent
timeline
title
URL
visibilityState
Document.visibilityState只读属性返回文档的可见性。
visibilityState: DocumentVisibilityState
属性值
DocumentVisibilityState
vlinkColor
该 Document.vlinkColor 属性获取/设置用户在文档中访问的链接的颜色。
vlinkColor: string
属性值
string
webkitExitFullscreen
webkitExitFullscreen: void
属性值
void
继承属性详细信息
activeElement
返回文档中最深的元素,其中或要路由到哪些关键事件。 大致而言,这是文档中重点元素。
出于此 API 的目的,当子浏览上下文聚焦时,其容器将集中在父浏览上下文中。 例如,如果用户将焦点移动到 iframe 中的文本控件,则 iframe 是 iframe 节点文档中 activeElement API 返回的元素。
同样,当焦点元素位于与 documentOrShadowRoot 不同的节点树中时,返回的元素将是与 documentOrShadowRoot 位于同一节点树中的主机(如果 documentOrShadowRoot 是包含包含焦点元素的独占上级),如果不是,则返回的元素将为 null。
activeElement: Element | null
属性值
Element | null
继承自 DocumentOrShadowRoot.activeElement
adoptedStyleSheets
adoptedStyleSheets: CSSStyleSheet[]
属性值
CSSStyleSheet[]
继承自 DocumentOrShadowRoot.adoptedStyleSheets
ATTRIBUTE_NODE
ATTRIBUTE_NODE: 2
属性值
2
继承自 Node.ATTRIBUTE_NODE 的
baseURI
CDATA_SECTION_NODE
节点是 CDATASection 节点。
CDATA_SECTION_NODE: 4
属性值
4
继承自 Node.CDATA_SECTION_NODE 的
childElementCount
childNodes
Node 接口的只读 childNodes 属性返回分配了第一个子节点的实时索引 0。
childNodes: NodeListOf<ChildNode>
属性值
NodeListOf<ChildNode>
继承自 Node.childNodes
children
COMMENT_NODE
节点是注释节点。
COMMENT_NODE: 8
属性值
8
继承自 Node.COMMENT_NODE 的
DOCUMENT_FRAGMENT_NODE
节点是 DocumentFragment 节点。
DOCUMENT_FRAGMENT_NODE: 11
属性值
11
继承自 Node.DOCUMENT_FRAGMENT_NODE 的
DOCUMENT_NODE
节点是文档。
DOCUMENT_NODE: 9
属性值
9
继承自 Node.DOCUMENT_NODE 的
DOCUMENT_POSITION_CONTAINED_BY
当其他节点是节点的后代时设置。
DOCUMENT_POSITION_CONTAINED_BY: 16
属性值
16
继承自 Node.DOCUMENT_POSITION_CONTAINED_BY 的
DOCUMENT_POSITION_CONTAINS
当其他节点是节点的上级时设置。
DOCUMENT_POSITION_CONTAINS: 8
属性值
8
继承自 Node.DOCUMENT_POSITION_CONTAINS
DOCUMENT_POSITION_DISCONNECTED
当节点和其他节点不在同一树中时设置。
DOCUMENT_POSITION_DISCONNECTED: 1
属性值
1
继承自 Node.DOCUMENT_POSITION_DISCONNECTED 的
DOCUMENT_POSITION_FOLLOWING
当其他节点位于以下节点时设置。
DOCUMENT_POSITION_FOLLOWING: 4
属性值
4
继承自 Node.DOCUMENT_POSITION_FOLLOWING 的
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32
属性值
32
继承自 Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC 的
DOCUMENT_POSITION_PRECEDING
设置其他节点之前的节点。
DOCUMENT_POSITION_PRECEDING: 2
属性值
2
继承自 Node.DOCUMENT_POSITION_PRECEDING 的
DOCUMENT_TYPE_NODE
node 是 doctype。
DOCUMENT_TYPE_NODE: 10
属性值
10
继承自 Node.DOCUMENT_TYPE_NODE 的
ELEMENT_NODE
node 是一个元素。
ELEMENT_NODE: 1
属性值
1
继承自 Node.ELEMENT_NODE 的
ENTITY_NODE
ENTITY_NODE: 6
属性值
6
继承自 Node.ENTITY_NODE 的
ENTITY_REFERENCE_NODE
ENTITY_REFERENCE_NODE: 5
属性值
5
继承自 Node.ENTITY_REFERENCE_NODE 的
firstChild
Node 接口的只读 firstChild 属性返回节点在树中的第一个子级,或者 null 节点没有子级。
firstChild: ChildNode | null
属性值
ChildNode | null
继承自 Node.firstChild
firstElementChild
返回作为元素的第一个子级,否则返回 null。
firstElementChild: Element | null
属性值
Element | null
继承自 ParentNode.firstElementChild
fonts
fullscreenElement
返回文档的全屏元素。
fullscreenElement: Element | null
属性值
Element | null
继承自 DocumentOrShadowRoot.fullscreenElement
isConnected
Node 接口的只读 isConnected 属性返回一个布尔值,指示节点是直接还是间接地连接到 Document 对象。
isConnected: boolean
属性值
boolean
继承自 Node.isConnected
lastChild
Node 接口的只读 lastChild 属性返回节点的最后一个子级,或者 null 如果没有子节点。
lastChild: ChildNode | null
属性值
ChildNode | null
继承自 Node.lastChild
lastElementChild
返回作为元素的最后一个子级,否则返回 null。
lastElementChild: Element | null
属性值
Element | null
继承自 ParentNode.lastElementChild
nextSibling
Node 接口的只读 nextSibling 属性将紧跟在其父节点的 Node.childNodes 中的指定节点之后返回节点,或者如果指定节点是父元素中的最后一个子节点,则返回 null 该节点。
nextSibling: ChildNode | null
属性值
ChildNode | null
继承自 Node.nextSibling
nodeName
nodeType
nodeValue
nodeValue Node 接口的属性返回或设置当前节点的值。
nodeValue: string | null
属性值
string | null
继承自 Node.nodeValue
NOTATION_NODE
NOTATION_NODE: 12
属性值
12
继承自 Node.NOTATION_NODE 的
onabort
onabort: (this: GlobalEventHandlers, ev: UIEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: UIEvent) => any | null
继承自 GlobalEventHandlers.onabort
onanimationcancel
onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
继承自 GlobalEventHandlers.onanimationcancel
onanimationend
onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
继承自 GlobalEventHandlers.onanimationend
onanimationiteration
onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
继承自 GlobalEventHandlers.onanimationiteration
onanimationstart
onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: AnimationEvent) => any | null
继承自 GlobalEventHandlers.onanimationstart
onauxclick
onauxclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onauxclick
onbeforeinput
onbeforeinput: (this: GlobalEventHandlers, ev: InputEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: InputEvent) => any | null
继承自 GlobalEventHandlers.onbeforeinput
onbeforematch
onbeforematch: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onbeforematch
onbeforetoggle
onbeforetoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ToggleEvent) => any | null
继承自 GlobalEventHandlers.onbeforetoggle
onblur
onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: FocusEvent) => any | null
继承自 GlobalEventHandlers.onblur
oncancel
oncancel: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 globalEventHandlers.oncancel 的
oncanplay
oncanplay: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oncanplay
oncanplaythrough
oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oncanplaythrough
onchange
onchange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onchange
onclick
onclick: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onclick
onclose
onclose: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onclose
oncontextlost
oncontextlost: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oncontextlost
oncontextmenu
oncontextmenu: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.oncontextmenu
oncontextrestored
oncontextrestored: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oncontextrestored
oncopy
oncopy: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
继承自 GlobalEventHandlers.oncopy
oncuechange
oncuechange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oncuechange
oncut
oncut: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
继承自 GlobalEventHandlers.oncut
ondblclick
ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.ondblclick
ondrag
ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondrag
ondragend
ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondragend
ondragenter
ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondragenter
ondragleave
ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondragleave
ondragover
ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondragover
ondragstart
ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondragstart
ondrop
ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: DragEvent) => any | null
继承自 GlobalEventHandlers.ondrop
ondurationchange
ondurationchange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.ondurationchange
onemptied
onemptied: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onemptied
onended
onended: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onended
onerror
onfocus
onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: FocusEvent) => any | null
继承自 GlobalEventHandlers.onfocus
onformdata
onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: FormDataEvent) => any | null
继承自 GlobalEventHandlers.onformdata
ongotpointercapture
ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.ongotpointercapture
oninput
oninput: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oninput
oninvalid
oninvalid: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.oninvalid
onkeydown
onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
继承自 GlobalEventHandlers.onkeydown
onkeypress
onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
继承自 GlobalEventHandlers.onkeypress 的
onkeyup
onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: KeyboardEvent) => any | null
继承自 GlobalEventHandlers.onkeyup
onload
onload: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onload
onloadeddata
onloadeddata: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onloadeddata
onloadedmetadata
onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onloadedmetadata
onloadstart
onloadstart: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onloadstart
onlostpointercapture
onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onlostpointercapture
onmousedown
onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmousedown
onmouseenter
onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmouseenter
onmouseleave
onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmouseleave
onmousemove
onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmousemove
onmouseout
onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmouseout
onmouseover
onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmouseover
onmouseup
onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: MouseEvent) => any | null
继承自 GlobalEventHandlers.onmouseup
onpaste
onpaste: (this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ClipboardEvent) => any | null
继承自 GlobalEventHandlers.onpaste
onpause
onpause: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onpause
onplay
onplay: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onplay
onplaying
onplaying: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onplaying
onpointercancel
onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointercancel
onpointerdown
onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerdown
onpointerenter
onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerenter
onpointerleave
onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerleave
onpointermove
onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointermove
onpointerout
onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerout
onpointerover
onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerover
onpointerrawupdate
仅在安全上下文中可用。
onpointerrawupdate: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onpointerrawupdate
onpointerup
onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: PointerEvent) => any | null
继承自 GlobalEventHandlers.onpointerup
onprogress
onprogress: (this: GlobalEventHandlers, ev: ProgressEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ProgressEvent) => any | null
继承自 GlobalEventHandlers.onprogress
onratechange
onratechange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onratechange
onreset
onreset: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onreset
onresize
onresize: (this: GlobalEventHandlers, ev: UIEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: UIEvent) => any | null
继承自 GlobalEventHandlers.onresize
onscroll
onscroll: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onscroll
onscrollend
onscrollend: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onscrollend
onsecuritypolicyviolation
onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any | null
继承自 GlobalEventHandlers.onsecuritypolicyviolation
onseeked
onseeked: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onseeked
onseeking
onseeking: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onseeking
onselect
onselect: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onselect
onselectionchange
onselectionchange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onselectionchange
onselectstart
onselectstart: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onselectstart
onslotchange
onslotchange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onslotchange
onstalled
onstalled: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onstalled
onsubmit
onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: SubmitEvent) => any | null
继承自 GlobalEventHandlers.onsubmit
onsuspend
onsuspend: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onsuspend
ontimeupdate
ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.ontimeupdate
ontoggle
ontoggle: (this: GlobalEventHandlers, ev: ToggleEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: ToggleEvent) => any | null
继承自 GlobalEventHandlers.onggle
ontouchcancel
ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
继承自 GlobalEventHandlers.ontouchcancel
ontouchend
ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
继承自 GlobalEventHandlers.ontouchend
ontouchmove
ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
继承自 GlobalEventHandlers.ontouchmove
ontouchstart
ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TouchEvent) => any | null
继承自 GlobalEventHandlers.ontouchstart
ontransitioncancel
ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
继承自 GlobalEventHandlers.ontransitioncancel
ontransitionend
ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
继承自 GlobalEventHandlers.ontransitionend
ontransitionrun
ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
继承自 GlobalEventHandlers.ontransitionrun
ontransitionstart
ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: TransitionEvent) => any | null
继承自 GlobalEventHandlers.ontransitionstart
onvolumechange
onvolumechange: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onvolumechange
onwaiting
onwaiting: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onwaiting
onwebkitanimationend
onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onwebkitanimationiteration
onwebkitanimationstart
onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onwebkitanimationstart
onwebkittransitionend
onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any | null
属性值
(this: GlobalEventHandlers, ev: Event) => any | null
继承自 GlobalEventHandlers.onwebkittransitionend
onwheel
onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any | null
属性值
(this: GlobalEventHandlers, ev: WheelEvent) => any | null
继承自 GlobalEventHandlers.onwheel
parentElement
Node 接口的只读 parentElement 属性返回 DOM 节点的父元素,或者 null 节点没有父元素,或者其父元素不是 DOM 元素。
parentElement: HTMLElement | null
属性值
HTMLElement | null
继承自 Node.parentElement
parentNode
Node 接口的只读 parentNode 属性返回 DOM 树中指定节点的父级。
parentNode: ParentNode | null
属性值
ParentNode | null
继承自 Node.parentNode
pictureInPictureElement
pictureInPictureElement: Element | null
属性值
Element | null
继承自 DocumentOrShadowRoot.pictureInPictureElement
pointerLockElement
pointerLockElement: Element | null
属性值
Element | null
继承自 DocumentOrShadowRoot.pointerLockElement
previousSibling
Node 接口的只读 previousSibling 属性返回紧邻其父节点中指定节点的前面,或者 null 指定节点是该列表中的第一个节点。
previousSibling: ChildNode | null
属性值
ChildNode | null
继承自 Node.previousSibling
PROCESSING_INSTRUCTION_NODE
节点是 ProcessingInstruction 节点。
PROCESSING_INSTRUCTION_NODE: 7
属性值
7
继承自 Node.PROCESSING_INSTRUCTION_NODE 的
styleSheets
TEXT_NODE
节点是文本节点。
TEXT_NODE: 3
属性值
3
继承自 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)
addEventListener() EventTarget 接口的方法设置一个函数,每当指定事件传递到目标时,就会调用该函数。
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)
Document.adoptNode() 将节点/dom 从另一个文档传输到方法的文档。
function adoptNode<T>(node: T): T
参数
- node
-
T
返回
T
captureEvents()
警告
现已弃用此 API。
function captureEvents()
caretPositionFromPoint(number, number, CaretPositionFromPointOptions)
caretPositionFromPoint() Document 接口的方法返回一个 CaretPosition 对象,该对象包含 DOM 节点,以及该节点中的插入符号和插入符号的字符偏移量。
function caretPositionFromPoint(x: number, y: number, options?: CaretPositionFromPointOptions): CaretPosition | null
参数
- x
-
number
- y
-
number
- options
-
CaretPositionFromPointOptions
返回
CaretPosition | null
caretRangeFromPoint(number, number)
警告
现已弃用此 API。
function caretRangeFromPoint(x: number, y: number): Range | null
参数
- x
-
number
- y
-
number
返回
Range | null
clear()
close()
createAttribute(string)
该方法 Document.createAttribute() 创建新的属性节点,并返回它。
function createAttribute(localName: string): Attr
参数
- localName
-
string
返回
Attr
createAttributeNS(string | null, string)
该方法 Document.createAttributeNS() 创建一个具有指定命名空间 URI 和限定名称的新属性节点,并返回它。
function createAttributeNS(namespace: string | null, qualifiedName: string): Attr
参数
- namespace
-
string | null
- qualifiedName
-
string
返回
Attr
createCDATASection(string)
createCDATASection() 创建新的 CDATA 节节点,并返回它。
function createCDATASection(data: string): CDATASection
参数
- data
-
string
返回
CDATASection
createComment(string)
createComment() 创建新的注释节点并返回它。
function createComment(data: string): Comment
参数
- data
-
string
返回
Comment
createDocumentFragment()
创建一个新的空 DocumentFragment,可以将 DOM 节点添加到其中以生成屏幕外 DOM 树。
function createDocumentFragment(): DocumentFragment
返回
DocumentFragment
createElement(string, ElementCreationOptions)
function createElement(tagName: string, options?: ElementCreationOptions): HTMLElement
参数
- tagName
-
string
- options
-
ElementCreationOptions
返回
HTMLElement
createElement<K>(K, ElementCreationOptions)
在 HTML 文档中,该方法创建由 localNamedocument.createElement() 指定的 HTML 元素;如果localName无法识别,则创建 HTMLUnknownElement。
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/1998/Math/MathML", string)
function createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: string): MathMLElement
参数
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- qualifiedName
-
string
返回
MathMLElement
createElementNS("http://www.w3.org/1999/xhtml", string)
创建具有指定命名空间 URI 和限定名称的元素。
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(string | null, string, ElementCreationOptions)
function createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element
参数
- namespaceURI
-
string | null
- qualifiedName
-
string
- options
-
ElementCreationOptions
返回
Element
createElementNS(string | null, string, string | ElementCreationOptions)
function createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element
参数
- namespace
-
string | null
- qualifiedName
-
string
- options
-
string | ElementCreationOptions
返回
Element
createElementNS<K>("http://www.w3.org/1998/Math/MathML", K)
function createElementNS<K>(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: K): MathMLElementTagNameMap[K]
参数
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- qualifiedName
-
K
返回
MathMLElementTagNameMap[K]
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("ContentVisibilityAutoStateChangeEvent")
function createEvent(eventInterface: "ContentVisibilityAutoStateChangeEvent"): ContentVisibilityAutoStateChangeEvent
参数
- eventInterface
-
"ContentVisibilityAutoStateChangeEvent"
返回
ContentVisibilityAutoStateChangeEvent
createEvent("CookieChangeEvent")
function createEvent(eventInterface: "CookieChangeEvent"): CookieChangeEvent
参数
- eventInterface
-
"CookieChangeEvent"
返回
CookieChangeEvent
createEvent("CustomEvent")
function createEvent(eventInterface: "CustomEvent"): CustomEvent
参数
- eventInterface
-
"CustomEvent"
返回
CustomEvent
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
参数
- eventInterface
-
"MessageEvent"
返回
MessageEvent
createEvent("MIDIConnectionEvent")
function createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent
参数
- eventInterface
-
"MIDIConnectionEvent"
返回
MIDIConnectionEvent
createEvent("MIDIMessageEvent")
function createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent
参数
- eventInterface
-
"MIDIMessageEvent"
返回
MIDIMessageEvent
createEvent("MouseEvent")
function createEvent(eventInterface: "MouseEvent"): MouseEvent
参数
- eventInterface
-
"MouseEvent"
返回
MouseEvent
createEvent("MouseEvents")
function createEvent(eventInterface: "MouseEvents"): MouseEvent
参数
- eventInterface
-
"MouseEvents"
返回
MouseEvent
createEvent("OfflineAudioCompletionEvent")
function createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent
参数
- eventInterface
-
"OfflineAudioCompletionEvent"
返回
OfflineAudioCompletionEvent
createEvent("PageRevealEvent")
function createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent
参数
- eventInterface
-
"PageRevealEvent"
返回
PageRevealEvent
createEvent("PageSwapEvent")
function createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent
参数
- eventInterface
-
"PageSwapEvent"
返回
PageSwapEvent
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
参数
- eventInterface
-
"ProgressEvent"
返回
ProgressEvent
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("TextEvent")
function createEvent(eventInterface: "TextEvent"): TextEvent
参数
- eventInterface
-
"TextEvent"
返回
TextEvent
createEvent("ToggleEvent")
function createEvent(eventInterface: "ToggleEvent"): ToggleEvent
参数
- eventInterface
-
"ToggleEvent"
返回
ToggleEvent
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, NodeFilter | null)
该方法 Document.createNodeIterator() 返回一个新 NodeIterator 对象。
function createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator
参数
- root
-
Node
- whatToShow
-
number
- filter
-
NodeFilter | null
返回
NodeIterator
createProcessingInstruction(string, string)
createProcessingInstruction() 生成新的处理指令节点并返回它。
function createProcessingInstruction(target: string, data: string): ProcessingInstruction
参数
- target
-
string
- data
-
string
返回
ProcessingInstruction
createRange()
该方法 Document.createRange() 返回新的 js-nolint createRange() None。
function createRange(): Range
返回
Range
createTextNode(string)
createTreeWalker(Node, number, NodeFilter | null)
创建 Document.createTreeWalker() 者方法返回新创建的 TreeWalker 对象。
function createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker
参数
- root
-
Node
- whatToShow
-
number
- filter
-
NodeFilter | null
返回
TreeWalker
execCommand(string, boolean, string)
该方法 execCommand 实现多个不同的命令。
function execCommand(commandId: string, showUI?: boolean, value?: string): boolean
参数
- commandId
-
string
- showUI
-
boolean
- value
-
string
返回
boolean
exitFullscreen()
Document 方法 exitFullscreen() 请求此文档中当前以全屏模式呈现的元素已退出全屏模式,从而还原屏幕的上一个状态。
function exitFullscreen(): Promise<void>
返回
Promise<void>
exitPictureInPicture()
exitPictureInPicture()文档界面的方法要求将当前浮动的本文档中包含的视频从图片中模式中取出,从而还原屏幕的先前状态。
function exitPictureInPicture(): Promise<void>
返回
Promise<void>
exitPointerLock()
exitPointerLock() Document 接口的方法以异步方式释放以前通过 Element.requestPointerLock 请求的指针锁。
function exitPointerLock()
getElementById(string)
返回其 ID 为 elementId 的节点后代中的第一个元素。
function getElementById(elementId: string): HTMLElement | null
参数
- elementId
-
string
返回
HTMLElement | null
getElementsByClassName(string)
getElementsByClassName具有所有给定类名的所有子元素的方法。
function getElementsByClassName(classNames: string): HTMLCollectionOf<Element>
参数
- classNames
-
string
返回
HTMLCollectionOf<Element>
getElementsByName(string)
getElementsByName() Document 对象的方法返回文档中具有给定name属性的元素的 NodeList 集合。
function getElementsByName(elementName: string): NodeListOf<HTMLElement>
参数
- elementName
-
string
返回
NodeListOf<HTMLElement>
getElementsByTagName(string)
function getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>
参数
- qualifiedName
-
string
返回
HTMLCollectionOf<Element>
getElementsByTagName<K>(K)
搜索 getElementsByTagName 完整文档的方法,包括根节点。
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]>
getElementsByTagName<K>(K)
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>
参数
- qualifiedName
-
K
返回
HTMLCollectionOf<MathMLElementTagNameMap[K]>
getElementsByTagName<K>(K)
警告
现已弃用此 API。
function getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
参数
- qualifiedName
-
K
返回
HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML", string)
function getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>
参数
- namespaceURI
-
"http://www.w3.org/1998/Math/MathML"
- localName
-
string
返回
HTMLCollectionOf<MathMLElement>
getElementsByTagNameNS("http://www.w3.org/1999/xhtml", string)
返回一个元素列表,其中包含属于给定命名空间的给定标记名称。
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(string | null, string)
function getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>
参数
- namespace
-
string | null
- localName
-
string
返回
HTMLCollectionOf<Element>
getSelection()
getSelection() Document 接口的方法返回与此文档关联的 Selection 对象,表示用户选择的文本范围或插入符号的当前位置。
function getSelection(): Selection | null
返回
Selection | null
hasFocus()
hasStorageAccess()
hasStorageAccess() Document 接口的方法返回一个 Promise,该 Promise 使用布尔值解析,该值指示文档是否有权访问第三方未分区的 Cookie。
function hasStorageAccess(): Promise<boolean>
返回
Promise<boolean>
importNode<T>(T, boolean | ImportNodeOptions)
Document 对象 importNode() 的方法会在以后创建插入到当前文档中的副本。
function importNode<T>(node: T, options?: boolean | ImportNodeOptions): T
参数
- node
-
T
- options
-
boolean | ImportNodeOptions
返回
T
open(string | URL, string, string)
function open(url: string | URL, name: string, features: string): Window | null
参数
- url
-
string | URL
- name
-
string
- features
-
string
返回
Window | null
open(string, string)
queryCommandEnabled(string)
该方法 Document.queryCommandEnabled() 报告是否由浏览器启用指定的编辑器命令。
function queryCommandEnabled(commandId: string): boolean
参数
- commandId
-
string
返回
boolean
queryCommandIndeterm(string)
警告
现已弃用此 API。
function queryCommandIndeterm(commandId: string): boolean
参数
- commandId
-
string
返回
boolean
queryCommandState(string)
该方法 queryCommandState() 将告诉你当前所选内容是否应用了特定的 Document.execCommand() 命令。
function queryCommandState(commandId: string): boolean
参数
- commandId
-
string
返回
boolean
queryCommandSupported(string)
该方法 Document.queryCommandSupported() 报告浏览器是否支持指定的编辑器命令。
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)
removeEventListener() EventTarget 接口的方法从目标中删除以前向 EventTarget.addEventListener() 注册的事件侦听器。
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()
requestStorageAccess() Document 接口的方法允许第三方上下文(即嵌入在 iframe 中)中加载的内容请求访问第三方 Cookie 和未分区状态。
function requestStorageAccess(): Promise<void>
返回
Promise<void>
startViewTransition(ViewTransitionUpdateCallback | StartViewTransitionOptions)
startViewTransition() Document 接口的方法启动新的同一文档(SPA)视图转换,并返回一个 ViewTransition 对象来表示它。
function startViewTransition(callbackOptions?: ViewTransitionUpdateCallback | StartViewTransitionOptions): ViewTransition
参数
- callbackOptions
-
ViewTransitionUpdateCallback | StartViewTransitionOptions
返回
ViewTransition
write(string[])
write() Document 接口的方法将一个或多个 TrustedHTML 或字符串参数中的文本写入 document.open 打开的文档流。
function write(text: string[])
参数
- text
-
string[]
writeln(string[])
writeln() Document 接口的方法将一个或多个 TrustedHTML 或字符串参数中的文本写入 document stream,该流由 document.open()打开,后跟换行符。
function writeln(text: string[])
参数
- text
-
string[]
继承的方法详细信息
append((string | Node)[])
在节点的最后一个子级之后插入节点,同时将节点中的字符串替换为等效的文本节点。
如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。
function append(nodes: (string | Node)[])
参数
- nodes
-
(string | Node)[]
继承自 ParentNode.append
appendChild<T>(T)
appendChild() Node 接口的方法将节点添加到指定父节点的子节点列表的末尾。
function appendChild<T>(node: T): T
参数
- node
-
T
返回
T
继承自 Node.appendChild
cloneNode(boolean)
Node cloneNode() 接口的方法返回调用此方法的节点的副本。
function cloneNode(subtree?: boolean): Node
参数
- subtree
-
boolean
返回
Node
继承自 Node.cloneNode
compareDocumentPosition(Node)
Node compareDocumentPosition() 接口的方法报告其自变量节点相对于调用它的节点的位置。
function compareDocumentPosition(other: Node): number
参数
- other
-
Node
返回
number
继承自 Node.compareDocumentPosition
contains(Node | null)
contains() Node 接口的方法返回一个布尔值,该值指示节点是否是给定节点的后代,即节点本身、其直接子级之一(Node.childNodes)、子级的直接子级之一等。
function contains(other: Node | null): boolean
参数
- other
-
Node | null
返回
boolean
继承自 Node.contains
createExpression(string, XPathNSResolver | null)
function createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression
参数
- expression
-
string
- resolver
-
XPathNSResolver | null
返回
XPathExpression
继承自 XPathEvaluatorBase.createExpression
createNSResolver(Node)
function createNSResolver(nodeResolver: Node): Node
参数
- nodeResolver
-
Node
返回
Node
继承自 XPathEvaluatorBase.createNSResolver
dispatchEvent(Event)
dispatchEvent() EventTarget 的方法按适当的顺序将事件发送到对象(同步)调用受影响的事件侦听器。
function dispatchEvent(event: Event): boolean
参数
- event
-
Event
返回
boolean
继承自 Node.dispatchEvent
elementFromPoint(number, number)
function elementFromPoint(x: number, y: number): Element | null
参数
- x
-
number
- y
-
number
返回
Element | null
继承自 DocumentOrShadowRoot.elementFromPoint
elementsFromPoint(number, number)
function elementsFromPoint(x: number, y: number): Element[]
参数
- x
-
number
- y
-
number
返回
Element[]
继承自 DocumentOrShadowRoot.elementsFromPoint
evaluate(string, Node, XPathNSResolver | null, number, XPathResult | null)
function evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: number, result?: XPathResult | null): XPathResult
参数
- expression
-
string
- contextNode
-
Node
- resolver
-
XPathNSResolver | null
- type
-
number
- result
-
XPathResult | null
返回
XPathResult
继承自 XPathEvaluatorBase.evaluate
getAnimations()
getRootNode(GetRootNodeOptions)
getRootNode() Node 接口的方法返回上下文对象的根,该根(可选)包括影子根(如果可用)。
function getRootNode(options?: GetRootNodeOptions): Node
参数
- options
-
GetRootNodeOptions
返回
Node
继承自 Node.getRootNode
hasChildNodes()
Node hasChildNodes() 接口的方法返回一个布尔值,该值指示给定节点是否具有子节点。
function hasChildNodes(): boolean
返回
boolean
继承自 Node.hasChildNodes
insertBefore<T>(T, Node | null)
Node insertBefore() 接口的方法在 引用节点 之前插入节点作为指定 父节点的子节点。
function insertBefore<T>(node: T, child: Node | null): T
参数
- node
-
T
- child
-
Node | null
返回
T
继承自 Node.insertBefore
isDefaultNamespace(string | null)
isDefaultNamespace() Node 接口的方法接受命名空间 URI 作为参数。
function isDefaultNamespace(namespace: string | null): boolean
参数
- namespace
-
string | null
返回
boolean
继承自 Node.isDefaultNamespace
isEqualNode(Node | null)
isEqualNode() Node 接口的方法测试两个节点是否相等。
function isEqualNode(otherNode: Node | null): boolean
参数
- otherNode
-
Node | null
返回
boolean
继承自 Node.isEqualNode
isSameNode(Node | null)
Node isSameNode() 接口的方法是严格相等运算符的 === 旧别名。
function isSameNode(otherNode: Node | null): boolean
参数
- otherNode
-
Node | null
返回
boolean
继承自 Node.isSameNode
lookupNamespaceURI(string | null)
Node lookupNamespaceURI() 接口的方法采用前缀作为参数,并返回与给定节点上关联的命名空间 URI(如果 null 找不到)。
function lookupNamespaceURI(prefix: string | null): string | null
参数
- prefix
-
string | null
返回
string | null
继承自 Node.lookupNamespaceURI
lookupPrefix(string | null)
Node lookupPrefix() 接口的方法返回一个字符串,其中包含给定命名空间 URI 的前缀(如果存在)以及 null 不存在的字符串。
function lookupPrefix(namespace: string | null): string | null
参数
- namespace
-
string | null
返回
string | null
继承自 Node.lookupPrefix
normalize()
prepend((string | Node)[])
在节点的第一个子级之前插入节点,同时将节点中的字符串替换为等效的文本节点。
如果违反节点树的约束,则引发“HierarchyRequestError”DOMException。
function prepend(nodes: (string | Node)[])
参数
- nodes
-
(string | Node)[]
继承自 ParentNode.prepend
querySelector<E>(string)
function querySelector<E>(selectors: string): E | null
参数
- selectors
-
string
返回
E | null
继承自 ParentNode.querySelector
querySelector<K>(K)
返回与选择器匹配的节点后代的第一个元素。
function querySelector<K>(selectors: K): HTMLElementTagNameMap[K] | null
参数
- selectors
-
K
返回
HTMLElementTagNameMap[K] | null
继承自 ParentNode.querySelector
querySelector<K>(K)
function querySelector<K>(selectors: K): SVGElementTagNameMap[K] | null
参数
- selectors
-
K
返回
SVGElementTagNameMap[K] | null
继承自 ParentNode.querySelector
querySelector<K>(K)
function querySelector<K>(selectors: K): MathMLElementTagNameMap[K] | null
参数
- selectors
-
K
返回
MathMLElementTagNameMap[K] | null
继承自 ParentNode.querySelector
querySelector<K>(K)
警告
现已弃用此 API。
function querySelector<K>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null
参数
- selectors
-
K
返回
HTMLElementDeprecatedTagNameMap[K] | null
继承自 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
querySelectorAll<K>(K)
function querySelectorAll<K>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>
参数
- selectors
-
K
返回
NodeListOf<MathMLElementTagNameMap[K]>
继承自 ParentNode.querySelectorAll
querySelectorAll<K>(K)
警告
现已弃用此 API。
function querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
参数
- selectors
-
K
返回
NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
继承自 ParentNode.querySelectorAll
removeChild<T>(T)
removeChild() Node 接口的方法从 DOM 中删除子节点,并返回已删除的节点。
function removeChild<T>(child: T): T
参数
- child
-
T
返回
T
继承自 Node.removeChild
replaceChild<T>(Node, T)
replaceChild() Node 接口的方法替换给定(父)节点中的子节点。
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