Document interface
介面代表 Document 瀏覽器中載入的任何網頁,並作為進入網頁內容的入口,該內容即 DOM 樹。
- Extends
-
Node,DocumentOrShadowRoot,FontFaceSource,GlobalEventHandlers,NonElementParentNode,ParentNode,XPathEvaluatorBase
屬性
| alink |
回傳或設定文件主體中活躍連結的顏色。 |
| all | 文件介面的唯讀 |
| anchors | An |
| applets |
|
| bg |
棄用屬性會 |
| body | 若不存在此類元素,則 |
| character |
|
| charset | |
| compat |
|
| content |
|
| cookie | 文件屬性 |
| current |
該 |
| default |
在瀏覽器中,回 |
| design |
|
| dir | 屬性是 |
| doctype |
|
| document |
|
| documentURI | A 字串的 |
| domain |
|
| embeds | An |
| fg |
|
| forms |
|
| fragment |
|
| fullscreen | 過時的文件介面的 |
| fullscreen |
文件介面上的唯讀 |
| head |
|
| hidden | 唯讀屬性會 |
| images | 文件介面的 |
| implementation | 該屬性回 |
| input |
|
| last |
|
| link |
這個 |
| links |
|
| location |
|
| moz |
|
| ms |
|
| onfullscreenchange | |
| onfullscreenerror | |
| onpointerlockchange | |
| onpointerlockerror | |
| onreadystatechange | |
| onvisibilitychange | |
| owner |
節點介面的唯讀 |
| picture |
可用 的唯讀 |
| plugins | 僅讀屬性, |
| ready |
該 |
| referrer | 該 |
| root |
|
| scripts |
|
| scrolling |
|
| text |
|
| timeline |
|
| title | 屬性 |
| URL | 文件介面的 |
| visibility |
|
| vlink |
這個 |
| webkit |
繼承的屬性
方法
繼承的方法
| append((string | Node)[]) | 在節點的最後一個子系之後插入節點,同時以對等的 Text 節點取代節點中的字串。 如果違反節點樹狀結構的條件約束,則會擲回 “HierarchyRequestError” DOMException。 |
| append |
|
| clone |
|
| compare |
|
| contains(Node | null) |
|
| create |
|
| create |
|
| dispatch |
|
| element |
|
| elements |
|
| evaluate(string, Node, XPath |
|
| get |
|
| get |
|
| has |
|
| insert |
|
| is |
|
| is |
|
| is |
|
| lookup |
|
| lookup |
|
| normalize() |
|
| prepend((string | Node)[]) | 在節點的第一個子系之前插入節點,同時以對等的 Text 節點取代節點中的字串。 如果違反節點樹狀結構的條件約束,則會擲回 “HierarchyRequestError” DOMException。 |
| query |
|
| query |
傳回符合選取器之節點子代的第一個專案。 |
| query |
|
| query |
|
| query |
|
| query |
|
| query |
傳回符合選取器之節點的所有元素子代。 |
| query |
|
| query |
|
| query |
|
| remove |
|
| replace |
|
| replace |
將節點的所有子系取代為節點,同時以對等的 Text 節點取代節點中的字串。 如果違反節點樹狀結構的條件約束,則會擲回 “HierarchyRequestError” DOMException。 |
屬性詳細資料
alinkColor
all
文件介面的唯讀 all 屬性會回傳一個根於文件節點的 HTMLAllCollection。
all: HTMLAllCollection
屬性值
HTMLAllCollection
anchors
An anchors HTMLCollection 的唯讀特性。
anchors: HTMLCollectionOf<HTMLAnchorElement>
屬性值
HTMLCollectionOf<HTMLAnchorElement>
applets
applets文件的屬性會回傳一個空的 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文件介面的唯讀屬性是一個 DocumentType 物件,代表與目前文件相關的 Doctype。
doctype: DocumentType | null
屬性值
DocumentType | null
documentElement
documentElement文件介面的唯讀屬性會回傳範例,即 HTML 文件的 HTML 元素。
documentElement: HTMLElement
屬性值
HTMLElement
documentURI
domain
embeds
An embeds HTMLCollection 的唯讀特性。
embeds: HTMLCollectionOf<HTMLEmbedElement>
屬性值
HTMLCollectionOf<HTMLEmbedElement>
fgColor
forms
forms文件介面的唯讀屬性會回傳一個 HTMLCollection,列出文件中所有表單元素。
forms: HTMLCollectionOf<HTMLFormElement>
屬性值
HTMLCollectionOf<HTMLFormElement>
fragmentDirective
fragmentDirective文件介面的唯讀特性會回傳當前文件的 FragmentDirective。
fragmentDirective: FragmentDirective
屬性值
FragmentDirective
fullscreen
過時的文件介面的 fullscreen 唯讀特性會報告文件是否目前以全螢幕模式顯示內容。
fullscreen: boolean
屬性值
boolean
fullscreenEnabled
head
hidden
images
文件介面的 images 唯讀特性會回傳目前 HTML 文件中的一組影像。
images: HTMLCollectionOf<HTMLImageElement>
屬性值
HTMLCollectionOf<HTMLImageElement>
implementation
該屬性回 Document.implementation 傳一個 DOMImplementation 物件。
implementation: DOMImplementation
屬性值
DOMImplementation
inputEncoding
inputEncoding: string
屬性值
string
lastModified
linkColor
links
links文件介面的唯讀特性會回傳所有區域元素的集合,以及文件中帶有 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 包含一個或多個代表 An HTMLCollection 的 HTMLEmbedElements。
plugins: HTMLCollectionOf<HTMLEmbedElement>
屬性值
HTMLCollectionOf<HTMLEmbedElement>
readyState
referrer
rootElement
Document.rootElement 如果該元素是文件,則回傳該文件的根元素。
rootElement: SVGSVGElement | null
屬性值
SVGSVGElement | null
scripts
scripts文件介面的屬性會回傳文件中腳本元素的清單。
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
node 是 CDATASection 節點。
CDATA_SECTION_NODE: 4
屬性值
4
繼承自 Node.CDATA_SECTION_NODE
childElementCount
childNodes
節點介面的唯 childNodes 讀特性會回傳一個活著的子節點,第一個子節點被指派索引 0。
childNodes: NodeListOf<ChildNode>
屬性值
NodeListOf<ChildNode>
繼承自 Node.childNodes
children
COMMENT_NODE
node 是批注節點。
COMMENT_NODE: 8
屬性值
8
繼承自 Node.COMMENT_NODE
DOCUMENT_FRAGMENT_NODE
node 是 DocumentFragment 節點。
DOCUMENT_FRAGMENT_NODE: 11
屬性值
11
繼承自 Node.DOCUMENT_FRAGMENT_NODE
DOCUMENT_NODE
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
節點介面的唯 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 讀特性會回傳一個布林值,指示該節點是否直接或間接連接到文件物件。
isConnected: boolean
屬性值
boolean
繼承自 Node.isConnected
lastChild
節點介面的唯 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
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.onprematch
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.ontoggle
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
節點介面的唯 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
節點介面的唯 previousSibling 讀特性會回傳其父節點中緊鄰指定的節點,或 null 若該指定節點是該清單中的第一個節點。
previousSibling: ChildNode | null
屬性值
ChildNode | null
繼承自 Node.previousSibling
PROCESSING_INSTRUCTION_NODE
node 是 ProcessingInstruction 節點。
PROCESSING_INSTRUCTION_NODE: 7
屬性值
7
繼承自 Node.PROCESSING_INSTRUCTION_NODE
styleSheets
TEXT_NODE
node 是 Text 節點。
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()文件介面的方法會回傳一個 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()
建立一個新的空文件片段,可加入 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 文件中,該 document.createElement() 方法會建立由 所 localName指定的 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()
文件方法 exitFullscreen() 要求將目前以全螢幕模式呈現的該文件元素從全螢幕模式中移除,恢復螢幕先前的狀態。
function exitFullscreen(): Promise<void>
傳回
Promise<void>
exitPictureInPicture()
exitPictureInPicture()文件介面的方法要求將本文件中目前漂浮的影片從畫中畫模式中移除,恢復螢幕先前的狀態。
function exitPictureInPicture(): Promise<void>
傳回
Promise<void>
exitPointerLock()
文件介面的方法會 exitPointerLock() 非同步釋放先前透過 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()文件物件的方法會回傳一個包含具有特定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()文件介面的方法會回傳與此文件相關的 Selection 物件,代表使用者所選擇的文字範圍,或是插入符號目前的位置。
function getSelection(): Selection | null
傳回
Selection | null
hasFocus()
hasStorageAccess()
hasStorageAccess()文件介面的方法會回傳一個 Promise,該承諾以布林值解析,表示文件是否能存取第三方未分割的 Cookie。
function hasStorageAccess(): Promise<boolean>
傳回
Promise<boolean>
importNode<T>(T, boolean | ImportNodeOptions)
文件物件的方法會 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()文件介面的方法允許載入於第三方情境(即嵌入 iframe)的內容,請求存取第三方 Cookie 及未分割狀態。
function requestStorageAccess(): Promise<void>
傳回
Promise<void>
startViewTransition(ViewTransitionUpdateCallback | StartViewTransitionOptions)
startViewTransition()文件介面的方法會啟動一個新的同文件(SPA)視圖轉換,並回傳一個 ViewTransition 物件來表示該視圖。
function startViewTransition(callbackOptions?: ViewTransitionUpdateCallback | StartViewTransitionOptions): ViewTransition
參數
- callbackOptions
-
ViewTransitionUpdateCallback | StartViewTransitionOptions
傳回
ViewTransition
write(string[])
write()文件介面的方法以一個或多個 TrustedHTML 或字串參數寫入由 document.open() 開啟的文件串流。
function write(text: string[])
參數
- text
-
string[]
writeln(string[])
writeln()文件介面的方法以一個或多個 TrustedHTML 或字串參數寫入由 document.open() 開啟的文件串流,後接換行字元。
function writeln(text: string[])
參數
- text
-
string[]
繼承的方法的詳細資料
append((string | Node)[])
在節點的最後一個子系之後插入節點,同時以對等的 Text 節點取代節點中的字串。
如果違反節點樹狀結構的條件約束,則會擲回 “HierarchyRequestError” DOMException。
function append(nodes: (string | Node)[])
參數
- nodes
-
(string | Node)[]
繼承自 parentNode.append
appendChild<T>(T)
appendChild()節點介面的方法將節點加入指定父節點子節點清單的末尾。
function appendChild<T>(node: T): T
參數
- node
-
T
傳回
T
繼承自 Node.appendChild
cloneNode(boolean)
cloneNode()節點介面的方法會回傳該方法所呼叫的節點的副本。
function cloneNode(subtree?: boolean): Node
參數
- subtree
-
boolean
傳回
Node
繼承自 Node.cloneNode
compareDocumentPosition(Node)
compareDocumentPosition()節點介面的方法會回報其參數節點相對於被呼叫節點的位置。
function compareDocumentPosition(other: Node): number
參數
- other
-
Node
傳回
number
繼承自 Node.compareDocumentPosition
contains(Node | null)
contains()節點介面的方法回傳一個布林值,表示節點是否為特定節點的後代,即該節點本身、其直接子節點之一(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()
hasChildNodes()節點介面的方法會回傳一個布林值,指示該節點是否有子節點。
function hasChildNodes(): boolean
傳回
boolean
繼承自 Node.hasChildNodes
insertBefore<T>(T, Node | null)
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()節點介面的方法測試兩個節點是否相等。
function isEqualNode(otherNode: Node | null): boolean
參數
- otherNode
-
Node | null
傳回
boolean
繼承自 Node.isEqualNode
isSameNode(Node | null)
isSameNode()節點介面的方法是一個傳統別名,用於嚴格===等號運算子。
function isSameNode(otherNode: Node | null): boolean
參數
- otherNode
-
Node | null
傳回
boolean
繼承自 Node.isSameNode
lookupNamespaceURI(string | null)
lookupNamespaceURI()節點介面的方法以前綴為參數,並在找到時回傳該節點對應的命名空間 URI(null若未找到則回傳)。
function lookupNamespaceURI(prefix: string | null): string | null
參數
- prefix
-
string | null
傳回
string | null
繼承自 Node.lookupNamespaceURI
lookupPrefix(string | null)
lookupPrefix() Node 介面的方法會回傳包含指定命名空間 URI 前綴的字串(若有null),若無則回傳。
function lookupPrefix(namespace: string | null): string | null
參數
- namespace
-
string | null
傳回
string | null
繼承自 Node.lookupPrefix
normalize()
prepend((string | Node)[])
在節點的第一個子系之前插入節點,同時以對等的 Text 節點取代節點中的字串。
如果違反節點樹狀結構的條件約束,則會擲回 “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()節點介面的方法會從 DOM 中移除一個子節點,並回傳被移除的節點。
function removeChild<T>(child: T): T
參數
- child
-
T
傳回
T
繼承自 Node.removeChild
replaceChild<T>(Node, T)
replaceChild()節點介面的方法會替換給定(父)節點中的子節點。
function replaceChild<T>(node: Node, child: T): T
參數
- node
-
Node
- child
-
T
傳回
T
繼承自 Node.replaceChild
replaceChildren((string | Node)[])
將節點的所有子系取代為節點,同時以對等的 Text 節點取代節點中的字串。
如果違反節點樹狀結構的條件約束,則會擲回 “HierarchyRequestError” DOMException。
function replaceChildren(nodes: (string | Node)[])
參數
- nodes
-
(string | Node)[]
繼承自 ParentNode.replaceChildren