Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
参数
namespace: null | string
qualifiedName: string
value: string
返回 void
setPointerCapture
setPointerCapture(pointerId): void
参数
pointerId: number
返回 void
toggleAttribute
toggleAttribute(qualifiedName, force?): boolean
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating
accessKey: string;
accessKeyLabel: string;
align: string;
ariaAtomic: null | string;
ariaAutoComplete: null | string;
ariaBusy: null | string;
ariaChecked: null | string;
ariaColCount: null | string;
ariaColIndex: null | string;
ariaColIndexText: null | string;
ariaColSpan: null | string;
ariaCurrent: null | string;
ariaDisabled: null | string;
ariaExpanded: null | string;
ariaHasPopup: null | string;
ariaHidden: null | string;
ariaInvalid: null | string;
ariaKeyShortcuts: null | string;
ariaLabel: null | string;
ariaLevel: null | string;
ariaLive: null | string;
ariaModal: null | string;
ariaMultiLine: null | string;
ariaMultiSelectable: null | string;
ariaOrientation: null | string;
ariaPlaceholder: null | string;
ariaPosInSet: null | string;
ariaPressed: null | string;
ariaReadOnly: null | string;
ariaRequired: null | string;
ariaRoleDescription: null | string;
ariaRowCount: null | string;
ariaRowIndex: null | string;
ariaRowIndexText: null | string;
ariaRowSpan: null | string;
ariaSelected: null | string;
ariaSetSize: null | string;
ariaSort: null | string;
ariaValueMax: null | string;
ariaValueMin: null | string;
ariaValueNow: null | string;
ariaValueText: null | string;
assignedSlot: null | HTMLSlotElement;
ATTRIBUTE_NODE: number;
attributes: NamedNodeMap;
autocapitalize: string;
autofocus: boolean;
baseURI: string;
CDATA_SECTION_NODE: number;
childElementCount: number;
childNodes: NodeListOf<ChildNode>;
children: HTMLCollection;
classList: DOMTokenList;
className: string;
clientHeight: number;
clientLeft: number;
clientTop: number;
clientWidth: number;
COMMENT_NODE: number;
contentEditable: string;
dataset: DOMStringMap;
dir: string;
DOCUMENT_FRAGMENT_NODE: number;
DOCUMENT_NODE: number;
DOCUMENT_POSITION_CONTAINED_BY: number;
DOCUMENT_POSITION_CONTAINS: number;
DOCUMENT_POSITION_DISCONNECTED: number;
DOCUMENT_POSITION_FOLLOWING: number;
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
DOCUMENT_POSITION_PRECEDING: number;
DOCUMENT_TYPE_NODE: number;
draggable: boolean;
ELEMENT_NODE: number;
enterKeyHint: string;
ENTITY_NODE: number;
ENTITY_REFERENCE_NODE: number;
firstChild: null | ChildNode;
firstElementChild: null | Element;
hidden: boolean;
id: string;
inert: boolean;
innerHTML: string;
innerText: string;
inputMode: string;
isConnected: boolean;
isContentEditable: boolean;
lang: string;
lastChild: null | ChildNode;
lastElementChild: null | Element;
localName: string;
namespaceURI: null | string;
nextElementSibling: null | Element;
nextSibling: null | ChildNode;
nodeName: string;
nodeType: number;
nodeValue: null | string;
nonce?: string;
NOTATION_NODE: number;
offsetHeight: number;
offsetLeft: number;
offsetParent: null | Element;
offsetTop: number;
offsetWidth: number;
onabort: null | ((this: GlobalEventHandlers, ev: UIEvent) => any);
onanimationcancel: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
onanimationend: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
onanimationiteration: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
onanimationstart: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any);
onauxclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onbeforeinput: null | ((this: GlobalEventHandlers, ev: InputEvent) => any);
onblur: null | ((this: GlobalEventHandlers, ev: FocusEvent) => any);
oncancel: null | ((this: GlobalEventHandlers, ev: Event) => any);
oncanplay: null | ((this: GlobalEventHandlers, ev: Event) => any);
oncanplaythrough: null | ((this: GlobalEventHandlers, ev: Event) => any);
onchange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onclose: null | ((this: GlobalEventHandlers, ev: Event) => any);
oncontextmenu: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
oncopy: null | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any);
oncuechange: null | ((this: GlobalEventHandlers, ev: Event) => any);
oncut: null | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any);
ondblclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
ondrag: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondragend: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondragenter: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondragleave: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondragover: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondragstart: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondrop: null | ((this: GlobalEventHandlers, ev: DragEvent) => any);
ondurationchange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onemptied: null | ((this: GlobalEventHandlers, ev: Event) => any);
onended: null | ((this: GlobalEventHandlers, ev: Event) => any);
onerror: OnErrorEventHandler;
onfocus: null | ((this: GlobalEventHandlers, ev: FocusEvent) => any);
onformdata: null | ((this: GlobalEventHandlers, ev: FormDataEvent) => any);
onfullscreenchange: null | ((this: Element, ev: Event) => any);
onfullscreenerror: null | ((this: Element, ev: Event) => any);
ongotpointercapture: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
oninput: null | ((this: GlobalEventHandlers, ev: Event) => any);
oninvalid: null | ((this: GlobalEventHandlers, ev: Event) => any);
onkeydown: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
onkeypress: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
onkeyup: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any);
onload: null | ((this: GlobalEventHandlers, ev: Event) => any);
onloadeddata: null | ((this: GlobalEventHandlers, ev: Event) => any);
onloadedmetadata: null | ((this: GlobalEventHandlers, ev: Event) => any);
onloadstart: null | ((this: GlobalEventHandlers, ev: Event) => any);
onlostpointercapture: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onmousedown: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmouseenter: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmouseleave: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmousemove: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmouseout: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmouseover: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onmouseup: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any);
onpaste: null | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any);
onpause: null | ((this: GlobalEventHandlers, ev: Event) => any);
onplay: null | ((this: GlobalEventHandlers, ev: Event) => any);
onplaying: null | ((this: GlobalEventHandlers, ev: Event) => any);
onpointercancel: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerdown: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerenter: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerleave: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointermove: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerout: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerover: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onpointerup: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any);
onprogress: null | ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any);
onratechange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onreset: null | ((this: GlobalEventHandlers, ev: Event) => any);
onresize: null | ((this: GlobalEventHandlers, ev: UIEvent) => any);
onscroll: null | ((this: GlobalEventHandlers, ev: Event) => any);
onsecuritypolicyviolation: null | ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any);
onseeked: null | ((this: GlobalEventHandlers, ev: Event) => any);
onseeking: null | ((this: GlobalEventHandlers, ev: Event) => any);
onselect: null | ((this: GlobalEventHandlers, ev: Event) => any);
onselectionchange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onselectstart: null | ((this: GlobalEventHandlers, ev: Event) => any);
onslotchange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onstalled: null | ((this: GlobalEventHandlers, ev: Event) => any);
onsubmit: null | ((this: GlobalEventHandlers, ev: SubmitEvent) => any);
onsuspend: null | ((this: GlobalEventHandlers, ev: Event) => any);
ontimeupdate: null | ((this: GlobalEventHandlers, ev: Event) => any);
ontoggle: null | ((this: GlobalEventHandlers, ev: Event) => any);
ontouchcancel?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any);
ontouchend?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any);
ontouchmove?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any);
ontouchstart?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any);
ontransitioncancel: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
ontransitionend: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
ontransitionrun: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
ontransitionstart: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any);
onvolumechange: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwaiting: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwebkitanimationend: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwebkitanimationiteration: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwebkitanimationstart: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwebkittransitionend: null | ((this: GlobalEventHandlers, ev: Event) => any);
onwheel: null | ((this: GlobalEventHandlers, ev: WheelEvent) => any);
outerHTML: string;
outerText: string;
ownerDocument: Document;
parentElement: null | HTMLElement;
parentNode: null | ParentNode;
part: DOMTokenList;
prefix: null | string;
previousElementSibling: null | Element;
previousSibling: null | ChildNode;
PROCESSING_INSTRUCTION_NODE: number;
role: null | string;
scrollHeight: number;
scrollLeft: number;
scrollTop: number;
scrollWidth: number;
shadowRoot: null | ShadowRoot;
slot: string;
spellcheck: boolean;
style: CSSStyleDeclaration;
tabIndex: number;
tagName: string;
TEXT_NODE: number;
textContent: null | string;
title: string;
translate: boolean;
addEventListener<K>(type: K, listener: ((this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
after(...nodes: (string | Node)[]): void;
animate(keyframes: null | PropertyIndexedKeyframes | Keyframe[], options?: number | KeyframeAnimationOptions): Animation;
append(...nodes: (string | Node)[]): void;
appendChild<T>(node: T): T;
attachInternals(): ElementInternals;
attachShadow(init: ShadowRootInit): ShadowRoot;
before(...nodes: (string | Node)[]): void;
blur(): void;
click(): void;
cloneNode(deep?: boolean): Node;
closest<K>(selector: K): null | HTMLElementTagNameMap[K];
closest<K>(selector: K): null | SVGElementTagNameMap[K];
closest<E>(selectors: string): null | E;
compareDocumentPosition(other: Node): number;
contains(other: null | Node): boolean;
dispatchEvent(event: Event): boolean;
focus(options?: FocusOptions): void;
getAnimations(options?: GetAnimationsOptions): Animation[];
getAttribute(qualifiedName: string): null | string;
getAttributeNames(): string[];
getAttributeNode(qualifiedName: string): null | Attr;
getAttributeNodeNS(namespace: null | string, localName: string): null | Attr;
getAttributeNS(namespace: null | string, localName: string): null | string;
getBoundingClientRect(): DOMRect;
getClientRects(): DOMRectList;
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
getElementsByTagName<K>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
getElementsByTagNameNS(namespace: null | string, localName: string): HTMLCollectionOf<Element>;
getRootNode(options?: GetRootNodeOptions): Node;
hasAttribute(qualifiedName: string): boolean;
hasAttributeNS(namespace: null | string, localName: string): boolean;
hasAttributes(): boolean;
hasChildNodes(): boolean;
hasPointerCapture(pointerId: number): boolean;
insertAdjacentElement(where: InsertPosition, element: Element): null | Element;
insertAdjacentHTML(position: InsertPosition, text: string): void;
insertAdjacentText(where: InsertPosition, data: string): void;
insertBefore<T>(node: T, child: null | Node): T;
isDefaultNamespace(namespace: null | string): boolean;
isEqualNode(otherNode: null | Node): boolean;
isSameNode(otherNode: null | Node): boolean;
lookupNamespaceURI(prefix: null | string): null | string;
lookupPrefix(namespace: null | string): null | string;
matches(selectors: string): boolean;
normalize(): void;
prepend(...nodes: (string | Node)[]): void;
querySelector<K>(selectors: K): null | HTMLElementTagNameMap[K];
querySelector<K>(selectors: K): null | SVGElementTagNameMap[K];
querySelector<E>(selectors: string): null | E;
querySelectorAll<K>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<E>(selectors: string): NodeListOf<E>;
releasePointerCapture(pointerId: number): void;
remove(): void;
removeAttribute(qualifiedName: string): void;
removeAttributeNode(attr: Attr): Attr;
removeAttributeNS(namespace: null | string, localName: string): void;
removeChild<T>(child: T): T;
removeEventListener<K>(type: K, listener: ((this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any), options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
replaceChild<T>(node: Node, child: T): T;
replaceChildren(...nodes: (string | Node)[]): void;
replaceWith(...nodes: (string | Node)[]): void;
requestFullscreen(options?: FullscreenOptions): Promise<void>;
requestPointerLock(): void;
scroll(options?: ScrollToOptions): void;
scroll(x: number, y: number): void;
scrollBy(options?: ScrollToOptions): void;
scrollBy(x: number, y: number): void;
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
scrollTo(options?: ScrollToOptions): void;
scrollTo(x: number, y: number): void;
setAttribute(qualifiedName: string, value: string): void;
setAttributeNode(attr: Attr): null | Attr;
setAttributeNodeNS(attr: Attr): null | Attr;
setAttributeNS(namespace: null | string, qualifiedName: string, value: string): void;
setPointerCapture(pointerId: number): void;
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
webkitMatchesSelector(selectors: string): boolean;
}
层级 (查看完整内容)
索引
属性
方法
属性
access Key
只读accessalign
Sets or retrieves how the object is aligned with adjacent text.
已被弃用
aria Atomic
aria Auto Complete
aria Busy
aria Checked
aria Col Count
aria Col Index
aria Col Index Text
aria Col Span
aria Current
aria Disabled
aria Expanded
aria Has Popup
aria Hidden
aria Invalid
aria Key Shortcuts
aria Label
aria Level
aria Live
aria Modal
aria Multi Line
aria Multi Selectable
aria Orientation
aria Placeholder
aria Pos In Set
aria Pressed
aria Read Only
aria Required
aria Role Description
aria Row Count
aria Row Index
aria Row Index Text
aria Row Span
aria Selected
aria Set Size
aria Sort
aria Value Max
aria Value Min
aria Value Now
aria Value Text
只读assigned只读ATTRIBUTE_只读attributesautocapitalize
autofocus
只读baseURIReturns node's node document's document base URL.
只读CDATA_node is a CDATASection node.
只读child只读childReturns the children.
只读childrenReturns the child elements.
只读classAllows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
class Name
Returns the value of element's class content attribute. Can be set to change it.
只读client只读client只读client只读client只读COMMENT_node is a Comment node.
content Editable
只读datasetdir
只读DOCUMENT_node is a DocumentFragment node.
只读DOCUMENT_node is a document.
只读DOCUMENT_Set when other is a descendant of node.
只读DOCUMENT_Set when other is an ancestor of node.
只读DOCUMENT_Set when node and other are not in the same tree.
只读DOCUMENT_Set when other is following node.
只读DOCUMENT_只读DOCUMENT_Set when other is preceding node.
只读DOCUMENT_node is a doctype.
draggable
只读ELEMENT_node is an element.
enter Key Hint
只读ENTITY_只读ENTITY_只读firstReturns the first child.
只读firstReturns the first child that is an element, and null otherwise.
hidden
id
Returns the value of element's id content attribute. Can be set to change it.
inert
innerHTML
inner Text
input Mode
只读isReturns true if node is connected and false otherwise.
只读islang
只读lastReturns the last child.
只读lastReturns the last child that is an element, and null otherwise.
只读localReturns the local name.
只读namespaceURIReturns the namespace.
只读nextReturns the first following sibling that is an element, and null otherwise.
只读nextReturns the next sibling.
只读nodeReturns a string appropriate for the type of node.
只读nodeReturns the type of node.
node Value
可选nonce只读NOTATION_只读offset只读offset只读offset只读offset只读offsetonabort
Fires when the user aborts the download.
参数: ev
The event.
onanimationcancel
onanimationend
onanimationiteration
onanimationstart
onauxclick
onbeforeinput
onblur
Fires when the object loses the input focus.
参数: ev
The focus event.
oncancel
oncanplay
Occurs when playback is possible, but would require further buffering.
参数: ev
The event.
oncanplaythrough
onchange
Fires when the contents of the object or selection have changed.
参数: ev
The event.
onclick
Fires when the user clicks the left mouse button on the object
参数: ev
The mouse event.
onclose
oncontextmenu
Fires when the user clicks the right mouse button in the client area, opening the context menu.
参数: ev
The mouse event.
oncopy
oncuechange
oncut
ondblclick
Fires when the user double-clicks the object.
参数: ev
The mouse event.
ondrag
Fires on the source object continuously during a drag operation.
参数: ev
The event.
ondragend
Fires on the source object when the user releases the mouse at the close of a drag operation.
参数: ev
The event.
ondragenter
Fires on the target element when the user drags the object to a valid drop target.
参数: ev
The drag event.
ondragleave
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
参数: ev
The drag event.
ondragover
Fires on the target element continuously while the user drags the object over a valid drop target.
参数: ev
The event.
ondragstart
Fires on the source object when the user starts to drag a text selection or selected object.
参数: ev
The event.
ondrop
ondurationchange
Occurs when the duration attribute is updated.
参数: ev
The event.
onemptied
Occurs when the media element is reset to its initial state.
参数: ev
The event.
onended
Occurs when the end of playback is reached.
参数: ev
The event
onerror
Fires when an error occurs during object loading.
参数: ev
The event.
onfocus
Fires when the object receives focus.
参数: ev
The event.
onformdata
onfullscreenchange
onfullscreenerror
ongotpointercapture
oninput
oninvalid
onkeydown
Fires when the user presses a key.
参数: ev
The keyboard event
onkeypress
Fires when the user presses an alphanumeric key.
参数: ev
The event.
已被弃用
onkeyup
Fires when the user releases a key.
参数: ev
The keyboard event
onload
Fires immediately after the browser loads the object.
参数: ev
The event.
onloadeddata
Occurs when media data is loaded at the current playback position.
参数: ev
The event.
onloadedmetadata
Occurs when the duration and dimensions of the media have been determined.
参数: ev
The event.
onloadstart
Occurs when Internet Explorer begins looking for media data.
参数: ev
The event.
onlostpointercapture
onmousedown
Fires when the user clicks the object with either mouse button.
参数: ev
The mouse event.
onmouseenter
onmouseleave
onmousemove
Fires when the user moves the mouse over the object.
参数: ev
The mouse event.
onmouseout
Fires when the user moves the mouse pointer outside the boundaries of the object.
参数: ev
The mouse event.
onmouseover
Fires when the user moves the mouse pointer into the object.
参数: ev
The mouse event.
onmouseup
Fires when the user releases a mouse button while the mouse is over the object.
参数: ev
The mouse event.
onpaste
onpause
Occurs when playback is paused.
参数: ev
The event.
onplay
Occurs when the play method is requested.
参数: ev
The event.
onplaying
Occurs when the audio or video has started playing.
参数: ev
The event.
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onprogress
Occurs to indicate progress while downloading media data.
参数: ev
The event.
onratechange
Occurs when the playback rate is increased or decreased.
参数: ev
The event.
onreset
Fires when the user resets a form.
参数: ev
The event.
onresize
onscroll
Fires when the user repositions the scroll box in the scroll bar on the object.
参数: ev
The event.
onsecuritypolicyviolation
onseeked
Occurs when the seek operation ends.
参数: ev
The event.
onseeking
Occurs when the current playback position is moved.
参数: ev
The event.
onselect
Fires when the current selection changes.
参数: ev
The event.
onselectionchange
onselectstart
onslotchange
onstalled
Occurs when the download has stopped.
参数: ev
The event.
onsubmit
onsuspend
Occurs if the load operation has been intentionally halted.
参数: ev
The event.
ontimeupdate
Occurs to indicate the current playback position.
参数: ev
The event.
ontoggle
可选ontouchcancel可选ontouchend可选ontouchmove可选ontouchstartontransitioncancel
ontransitionend
ontransitionrun
ontransitionstart
onvolumechange
Occurs when the volume is changed, or playback is muted or unmuted.
参数: ev
The event.
onwaiting
Occurs when playback stops because the next frame of a video resource is not available.
参数: ev
The event.
onwebkitanimationend
已被弃用
This is a legacy alias of
onanimationend.onwebkitanimationiteration
已被弃用
This is a legacy alias of
onanimationiteration.onwebkitanimationstart
已被弃用
This is a legacy alias of
onanimationstart.onwebkittransitionend
已被弃用
This is a legacy alias of
ontransitionend.onwheel
outerHTML
outer Text
只读ownerReturns the node document. Returns null for documents.
只读parentReturns the parent element.
只读parentReturns the parent.
只读part只读prefixReturns the namespace prefix.
只读previousReturns the first preceding sibling that is an element, and null otherwise.
只读previousReturns the previous sibling.
只读PROCESSING_node is a ProcessingInstruction node.
role
只读scrollscroll Left
scroll Top
只读scroll只读shadowReturns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
slot
Returns the value of element's slot content attribute. Can be set to change it.
spellcheck
只读styletab Index
只读tagReturns the HTML-uppercased qualified name.
只读TEXT_node is a Text node.
text Content
title
translate
方法
add Event Listener
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
类型参数
参数
参数
返回 any
可选options: boolean | AddEventListenerOptions返回 void
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
参数
可选options: boolean | AddEventListenerOptions返回 void
after
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
animate
参数
可选options: number | KeyframeAnimationOptions返回 Animation
append
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
append Child
类型参数
参数
返回 T
attach Internals
返回 ElementInternals
attach Shadow
Creates a shadow root for element and returns it.
参数
返回 ShadowRoot
before
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
blur
返回 void
click
返回 void
clone Node
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
参数
可选deep: boolean返回 Node
closest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
类型参数
参数
返回 null | HTMLElementTagNameMap[K]
类型参数
参数
返回 null | SVGElementTagNameMap[K]
类型参数
参数
返回 null | E
compare Document Position
Returns a bitmask indicating the position of other relative to node.
参数
返回 number
contains
Returns true if other is an inclusive descendant of node, and false otherwise.
参数
返回 boolean
dispatch Event
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
参数
返回 boolean
focus
参数
可选options: FocusOptions返回 void
get Animations
参数
可选options: GetAnimationsOptions返回 Animation[]
get Attribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
参数
返回 null | string
get Attribute Names
Returns the qualified names of all element's attributes. Can contain duplicates.
返回 string[]
get Attribute Node
参数
返回 null | Attr
get Attribute NodeNS
参数
返回 null | Attr
get AttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
参数
返回 null | string
get Bounding Client Rect
返回 DOMRect
get Client Rects
返回 DOMRectList
get Elements By Class Name
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
参数
返回 HTMLCollectionOf<Element>
get Elements By Tag Name
类型参数
参数
返回 HTMLCollectionOf<HTMLElementTagNameMap[K]>
类型参数
参数
返回 HTMLCollectionOf<SVGElementTagNameMap[K]>
参数
返回 HTMLCollectionOf<Element>
get Elements By Tag NameNS
参数
返回 HTMLCollectionOf<HTMLElement>
参数
返回 HTMLCollectionOf<SVGElement>
参数
返回 HTMLCollectionOf<Element>
get Root Node
Returns node's root.
参数
可选options: GetRootNodeOptions返回 Node
has Attribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
参数
返回 boolean
has AttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName.
参数
返回 boolean
has Attributes
Returns true if element has attributes, and false otherwise.
返回 boolean
has Child Nodes
Returns whether node has children.
返回 boolean
has Pointer Capture
参数
返回 boolean
insert Adjacent Element
参数
返回 null | Element
insert AdjacentHTML
参数
返回 void
insert Adjacent Text
参数
返回 void
insert Before
类型参数
参数
返回 T
is Default Namespace
参数
返回 boolean
is Equal Node
Returns whether node and otherNode have the same properties.
参数
返回 boolean
is Same Node
参数
返回 boolean
lookup NamespaceURI
参数
返回 null | string
lookup Prefix
参数
返回 null | string
matches
Returns true if matching selectors against element's root yields element, and false otherwise.
参数
返回 boolean
normalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
返回 void
prepend
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
query Selector
Returns the first element that is a descendant of node that matches selectors.
类型参数
参数
返回 null | HTMLElementTagNameMap[K]
类型参数
参数
返回 null | SVGElementTagNameMap[K]
类型参数
参数
返回 null | E
query Selector All
Returns all element descendants of node that match selectors.
类型参数
参数
返回 NodeListOf<HTMLElementTagNameMap[K]>
类型参数
参数
返回 NodeListOf<SVGElementTagNameMap[K]>
类型参数
参数
返回 NodeListOf<E>
release Pointer Capture
参数
返回 void
remove
Removes node.
返回 void
remove Attribute
Removes element's first attribute whose qualified name is qualifiedName.
参数
返回 void
remove Attribute Node
参数
返回 Attr
remove AttributeNS
Removes element's attribute whose namespace is namespace and local name is localName.
参数
返回 void
remove Child
类型参数
参数
返回 T
remove Event Listener
Removes the event listener in target's event listener list with the same type, callback, and options.
类型参数
参数
参数
返回 any
可选options: boolean | EventListenerOptions返回 void
Removes the event listener in target's event listener list with the same type, callback, and options.
参数
可选options: boolean | EventListenerOptions返回 void
replace Child
类型参数
参数
返回 T
replace Children
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
replace With
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
参数
动态参数...nodes: (string | Node)[]返回 void
request Fullscreen
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
参数
可选options: FullscreenOptions返回 Promise<void>
request Pointer Lock
返回 void
scroll
参数
可选options: ScrollToOptions返回 void
参数
返回 void
scroll By
参数
可选options: ScrollToOptions返回 void
参数
返回 void
scroll Into View
参数
可选arg: boolean | ScrollIntoViewOptions返回 void
scroll To
参数
可选options: ScrollToOptions返回 void
参数
返回 void
set Attribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
参数
返回 void
set Attribute Node
参数
返回 null | Attr
set Attribute NodeNS
参数
返回 null | Attr
set AttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
参数
返回 void
set Pointer Capture
参数
返回 void
toggle Attribute
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
参数
可选force: boolean返回 boolean
webkit Matches Selector
参数
返回 boolean
已被弃用
This is a legacy alias of
matches.显示设置
目录
属性
方法