HTMLObjectElement

Provides special properties and methods (beyond those on the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of element, representing external resources.

MDN Reference

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var ariaInvalid: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns node's node document's document base URL.

Link copied to clipboard

node is a CDATASection node.

Link copied to clipboard
Link copied to clipboard

Returns the children.

Link copied to clipboard

Returns the child elements.

Link copied to clipboard

Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.

Link copied to clipboard

Returns the value of element's class content attribute. Can be set to change it.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

node is a Comment node.

Link copied to clipboard

Retrieves the document object of the page or frame.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Sets or retrieves the URL that references the data of the object.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

node is a DocumentFragment node.

Link copied to clipboard

node is a document.

Link copied to clipboard

Set when other is a descendant of node.

Link copied to clipboard

Set when other is an ancestor of node.

Link copied to clipboard

Set when node and other are not in the same tree.

Link copied to clipboard

Set when other is following node.

Link copied to clipboard

Set when other is preceding node.

Link copied to clipboard

node is a doctype.

Link copied to clipboard
Link copied to clipboard

node is an element.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the first child.

Link copied to clipboard

Returns the first child that is an element, and null otherwise.

Link copied to clipboard
open override val form: HTMLFormElement?

Retrieves a reference to the form that the object is embedded in.

Link copied to clipboard

Sets or retrieves the height of the object.

Link copied to clipboard
Link copied to clipboard
var id: String

Returns the value of element's id content attribute. Can be set to change it.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns true if node is connected and false otherwise.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the last child.

Link copied to clipboard

Returns the last child that is an element, and null otherwise.

Link copied to clipboard
Link copied to clipboard

Returns the local name.

Link copied to clipboard
open override var name: String

Sets or retrieves the name of the object.

Link copied to clipboard

Returns the namespace.

Link copied to clipboard

Returns the first following sibling that is an element, and null otherwise.

Link copied to clipboard

Returns the next sibling.

Link copied to clipboard

Returns a string appropriate for the type of node.

Link copied to clipboard

Returns the type of node.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Fires when the user aborts the download.

Link copied to clipboard

Fires when the object loses the input focus.

Link copied to clipboard

Occurs when playback is possible, but would require further buffering.

Link copied to clipboard

Fires when the contents of the object or selection have changed.

Link copied to clipboard

Fires when the user clicks the left mouse button on the object

Link copied to clipboard

Fires when the user clicks the right mouse button in the client area, opening the context menu.

Link copied to clipboard

Fires when the user double-clicks the object.

Link copied to clipboard

Fires on the source object continuously during a drag operation.

Link copied to clipboard

Fires on the source object when the user releases the mouse at the close of a drag operation.

Link copied to clipboard

Fires on the target element when the user drags the object to a valid drop target.

Link copied to clipboard

Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

Link copied to clipboard

Fires on the target element continuously while the user drags the object over a valid drop target.

Link copied to clipboard

Fires on the source object when the user starts to drag a text selection or selected object.

Link copied to clipboard
Link copied to clipboard

Occurs when the duration attribute is updated.

Link copied to clipboard

Occurs when the media element is reset to its initial state.

Link copied to clipboard

Occurs when the end of playback is reached.

Link copied to clipboard
open var onerror: Function<Unit>?

Fires when an error occurs during object loading.

Link copied to clipboard

Fires when the object receives focus.

Link copied to clipboard
Link copied to clipboard

Fires when the user presses a key.

Link copied to clipboard

Fires when the user releases a key.

Link copied to clipboard

Fires immediately after the browser loads the object.

Link copied to clipboard

Occurs when media data is loaded at the current playback position.

Link copied to clipboard

Occurs when the duration and dimensions of the media have been determined.

Link copied to clipboard

Occurs when Internet Explorer begins looking for media data.

Link copied to clipboard

Fires when the user clicks the object with either mouse button.

Link copied to clipboard

Fires when the user moves the mouse over the object.

Link copied to clipboard

Fires when the user moves the mouse pointer outside the boundaries of the object.

Link copied to clipboard

Fires when the user moves the mouse pointer into the object.

Link copied to clipboard

Fires when the user releases a mouse button while the mouse is over the object.

Link copied to clipboard

Occurs when playback is paused.

Link copied to clipboard

Occurs when the play method is requested.

Link copied to clipboard

Occurs when the audio or video has started playing.

Link copied to clipboard

Occurs to indicate progress while downloading media data.

Link copied to clipboard

Occurs when the playback rate is increased or decreased.

Link copied to clipboard

Fires when the user resets a form.

Link copied to clipboard

Fires when the user repositions the scroll box in the scroll bar on the object.

Link copied to clipboard

Occurs when the seek operation ends.

Link copied to clipboard

Occurs when the current playback position is moved.

Link copied to clipboard

Fires when the current selection changes.

Link copied to clipboard

Occurs when the download has stopped.

Link copied to clipboard

Occurs if the load operation has been intentionally halted.

Link copied to clipboard

Occurs to indicate the current playback position.

Link copied to clipboard

Occurs when the volume is changed, or playback is muted or unmuted.

Link copied to clipboard

Occurs when playback stops because the next frame of a video resource is not available.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val ownerDocument: Document

Returns the node document. Returns null for documents.

Link copied to clipboard

Returns the parent element.

Link copied to clipboard

Returns the parent.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the namespace prefix.

Link copied to clipboard

Returns the first preceding sibling that is an element, and null otherwise.

Link copied to clipboard

Returns the previous sibling.

Link copied to clipboard

node is a ProcessingInstruction node.

Link copied to clipboard
open var role: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.

Link copied to clipboard

Returns the value of element's slot content attribute. Can be set to change it.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the HTML-uppercased qualified name.

Link copied to clipboard

node is a Text node.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Sets or retrieves the MIME type of the object.

Link copied to clipboard
Link copied to clipboard
open override val validationMessage: String

Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.

Link copied to clipboard
open override val validity: ValidityState

Returns a ValidityState object that represents the validity states of an element.

Link copied to clipboard
Link copied to clipboard

Sets or retrieves the width of the object.

Link copied to clipboard
open override val willValidate: Boolean

Returns whether an element will successfully validate based on forms validation rules and constraints.

Link copied to clipboard

Functions

Link copied to clipboard
open fun after(vararg nodes: Any)

Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
open fun animate(keyframes: ReadonlyArray<Keyframe>?, options: Double = definedExternally): Animation
open fun animate(keyframes: PropertyIndexedKeyframes?, options: Double = definedExternally): Animation
Link copied to clipboard
open fun append(vararg nodes: Any)

Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates a shadow root for element and returns it.

Link copied to clipboard
open fun before(vararg nodes: Any)

Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
Link copied to clipboard
open override fun checkValidity(): Boolean

Returns whether a form will validate when it is submitted, without having to submit it.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun cloneNode(deep: Boolean = definedExternally): Node

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Link copied to clipboard
fun closest(selector: String): Element?
fun <T : MathMLElement> closest(selector: MathMLTagName<T>): T?
fun <T : SVGElement> closest(selector: SvgTagName<T>): T?

fun <T : HTMLElement> closest(selector: HtmlTagName<T>): T?

Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.

Link copied to clipboard

Returns a bitmask indicating the position of other relative to node.

Link copied to clipboard
fun contains(other: Node?): Boolean

Returns true if other is an inclusive descendant of node, and false otherwise.

Link copied to clipboard
Link copied to clipboard
open fun focus(options: FocusOptions = definedExternally)
Link copied to clipboard
Link copied to clipboard
fun getAttribute(qualifiedName: String): String?

Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.

Link copied to clipboard

Returns the qualified names of all element's attributes. Can contain duplicates.

Link copied to clipboard
Link copied to clipboard
fun getAttributeNodeNS(namespace: String?, localName: String): Attr?
Link copied to clipboard
fun getAttributeNS(namespace: String?, localName: String): String?

Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
fun getHTML(options: GetHTMLOptions = definedExternally): String
Link copied to clipboard
fun getRootNode(options: GetRootNodeOptions = definedExternally): Node

Returns node's root.

Link copied to clipboard
Link copied to clipboard
fun hasAttribute(qualifiedName: String): Boolean

Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

Link copied to clipboard
fun hasAttributeNS(namespace: String?, localName: String): Boolean

Returns true if element has an attribute whose namespace is namespace and local name is localName.

Link copied to clipboard

Returns true if element has attributes, and false otherwise.

Link copied to clipboard

Returns whether node has children.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Node> insertBefore(node: T, child: Node?): T
Link copied to clipboard
Link copied to clipboard
fun isEqualNode(otherNode: Node?): Boolean

Returns whether node and otherNode have the same properties.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun matches(selectors: String): Boolean

Returns true if matching selectors against element's root yields element, and false otherwise.

Link copied to clipboard
fun normalize()

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

Link copied to clipboard
open fun prepend(vararg nodes: Any)

Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
open fun querySelector(selectors: String): Element?
open fun <T : MathMLElement> querySelector(selectors: MathMLTagName<T>): T?
open fun <T : SVGElement> querySelector(selectors: SvgTagName<T>): T?

open fun <T : HTMLElement> querySelector(selectors: HtmlTagName<T>): T?

Returns the first element that is a descendant of node that matches selectors.

Link copied to clipboard
open fun querySelectorAll(selectors: String): NodeListOf<Element>
open fun <T : SVGElement> querySelectorAll(selectors: SvgTagName<T>): NodeListOf<T>

open fun <T : HTMLElement> querySelectorAll(selectors: HtmlTagName<T>): NodeListOf<T>

Returns all element descendants of node that match selectors.

Link copied to clipboard
Link copied to clipboard
open fun remove()

Removes node.

Link copied to clipboard
fun removeAttribute(qualifiedName: String)

Removes element's first attribute whose qualified name is qualifiedName.

Link copied to clipboard
Link copied to clipboard
fun removeAttributeNS(namespace: String?, localName: String)

Removes element's attribute whose namespace is namespace and local name is localName.

Link copied to clipboard
fun <T : Node> removeChild(child: T): T
Link copied to clipboard
fun <T : Node> replaceChild(node: Node, child: T): T
Link copied to clipboard
open fun replaceChildren(vararg nodes: Any)

Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
open fun replaceWith(vararg nodes: Any)

Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

Link copied to clipboard
Link copied to clipboard
suspend fun requestFullscreen(options: FullscreenOptions = definedExternally)

Displays element fullscreen and resolves promise when done.

Link copied to clipboard
fun requestFullscreenAsync(options: FullscreenOptions = definedExternally): Promise<Void>
Link copied to clipboard
suspend fun requestPointerLock(options: PointerLockOptions = definedExternally)
Link copied to clipboard
fun requestPointerLockAsync(options: PointerLockOptions = definedExternally): Promise<Void>
Link copied to clipboard
fun scroll(options: ScrollToOptions = definedExternally)
fun scroll(x: Double, y: Double)
Link copied to clipboard
fun scrollBy(options: ScrollToOptions = definedExternally)
fun scrollBy(x: Double, y: Double)
Link copied to clipboard
fun scrollIntoView(options: ScrollIntoViewOptions = definedExternally)
Link copied to clipboard
fun scrollTo(options: ScrollToOptions = definedExternally)
fun scrollTo(x: Double, y: Double)
Link copied to clipboard
fun setAttribute(qualifiedName: String, value: String)

Sets the value of element's first attribute whose qualified name is qualifiedName to value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setAttributeNS(namespace: String?, qualifiedName: String, value: String)

Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

Link copied to clipboard

Sets a custom error message that is displayed when a form is submitted.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun toggleAttribute(qualifiedName: String, force: Boolean = definedExternally): 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.

Link copied to clipboard
fun togglePopover(force: Boolean = definedExternally): Boolean