Element

JS
1.1
abstract class Element : 
    Node,
    ParentNode,
    NonDocumentTypeChildNode,
    ChildNode,
    Slotable,
    GeometryUtils,
    UnionElementOrHTMLCollection,
    UnionElementOrRadioNodeList,
    UnionElementOrMouseEvent,
    UnionElementOrProcessingInstruction

Exposes the JavaScript Element to Kotlin

Constructors

JS
1.1

<init>

Exposes the JavaScript Element to Kotlin

Element()

Properties

JS
1.1

attributes

open val attributes: NamedNodeMap
JS
1.1

classList

open val classList: DOMTokenList
JS
1.1

className

open var className: String
JS
1.1

clientHeight

open val clientHeight: Int
JS
1.1

clientLeft

open val clientLeft: Int
JS
1.1

clientTop

open val clientTop: Int
JS
1.1

clientWidth

open val clientWidth: Int
JS
1.1

id

open var id: String
JS
1.1

innerHTML

open var innerHTML: String
JS
1.1

localName

open val localName: String
JS
1.1

namespaceURI

open val namespaceURI: String?
JS
1.1

outerHTML

open var outerHTML: String
JS
1.1

prefix

open val prefix: String?
JS
1.1

scrollHeight

open val scrollHeight: Int
JS
1.1

scrollLeft

open var scrollLeft: Double
JS
1.1

scrollTop

open var scrollTop: Double
JS
1.1

scrollWidth

open val scrollWidth: Int
JS
1.1

shadowRoot

open val shadowRoot: ShadowRoot?
JS
1.1

slot

open var slot: String
JS
1.1

tagName

open val tagName: String

Functions

JS
1.1

attachShadow

fun attachShadow(init: ShadowRootInit): ShadowRoot
JS
1.1

closest

fun closest(selectors: String): Element?
JS
1.1

getAttribute

fun getAttribute(qualifiedName: String): String?
JS
1.1

getAttributeNames

fun getAttributeNames(): Array<String>
JS
1.1

getAttributeNode

fun getAttributeNode(qualifiedName: String): Attr?
JS
1.1

getAttributeNodeNS

fun getAttributeNodeNS(
    namespace: String?,
    localName: String
): Attr?
JS
1.1

getAttributeNS

fun getAttributeNS(
    namespace: String?,
    localName: String
): String?
JS
1.1

getBoundingClientRect

fun getBoundingClientRect(): DOMRect
JS
1.1

getClientRects

fun getClientRects(): Array<DOMRect>
JS
1.1

getElementsByClassName

fun getElementsByClassName(
    classNames: String
): HTMLCollection
JS
1.1

getElementsByTagName

fun getElementsByTagName(
    qualifiedName: String
): HTMLCollection
JS
1.1

getElementsByTagNameNS

fun getElementsByTagNameNS(
    namespace: String?,
    localName: String
): HTMLCollection
JS
1.1

hasAttribute

fun hasAttribute(qualifiedName: String): Boolean
JS
1.1

hasAttributeNS

fun hasAttributeNS(
    namespace: String?,
    localName: String
): Boolean
JS
1.1

hasAttributes

fun hasAttributes(): Boolean
JS
1.1

hasPointerCapture

fun hasPointerCapture(pointerId: Int): Boolean
JS
1.1

insertAdjacentElement

fun insertAdjacentElement(
    where: String,
    element: Element
): Element?
JS
1.1

insertAdjacentHTML

fun insertAdjacentHTML(position: String, text: String)
JS
1.1

insertAdjacentText

fun insertAdjacentText(where: String, data: String)
JS
1.1

matches

fun matches(selectors: String): Boolean
JS
1.1

releasePointerCapture

fun releasePointerCapture(pointerId: Int)
JS
1.1

removeAttribute

fun removeAttribute(qualifiedName: String)
JS
1.1

removeAttributeNode

fun removeAttributeNode(attr: Attr): Attr
JS
1.1

removeAttributeNS

fun removeAttributeNS(namespace: String?, localName: String)
JS
1.1

requestFullscreen

fun requestFullscreen(): Promise<Unit>
JS
1.1

scroll

fun scroll(options: ScrollToOptions = definedExternally)
fun scroll(x: Double, y: Double)
JS
1.1

scrollBy

fun scrollBy(options: ScrollToOptions = definedExternally)
fun scrollBy(x: Double, y: Double)
JS
1.1

scrollIntoView

fun scrollIntoView()
fun scrollIntoView(arg: dynamic)
JS
1.1

scrollTo

fun scrollTo(options: ScrollToOptions = definedExternally)
fun scrollTo(x: Double, y: Double)
JS
1.1

setAttribute

fun setAttribute(qualifiedName: String, value: String)
JS
1.1

setAttributeNode

fun setAttributeNode(attr: Attr): Attr?
JS
1.1

setAttributeNodeNS

fun setAttributeNodeNS(attr: Attr): Attr?
JS
1.1

setAttributeNS

fun setAttributeNS(
    namespace: String?,
    qualifiedName: String,
    value: String)
JS
1.1

setPointerCapture

fun setPointerCapture(pointerId: Int)
JS
1.1

webkitMatchesSelector

fun webkitMatchesSelector(selectors: String): Boolean

Companion Object Properties

JS
1.1

ATTRIBUTE_NODE

val ATTRIBUTE_NODE: Short
JS
1.1

CDATA_SECTION_NODE

val CDATA_SECTION_NODE: Short
JS
1.1

COMMENT_NODE

val COMMENT_NODE: Short
JS
1.1

DOCUMENT_FRAGMENT_NODE

val DOCUMENT_FRAGMENT_NODE: Short
JS
1.1

DOCUMENT_NODE

val DOCUMENT_NODE: Short
JS
1.1

DOCUMENT_POSITION_CONTAINED_BY

val DOCUMENT_POSITION_CONTAINED_BY: Short
JS
1.1

DOCUMENT_POSITION_CONTAINS

val DOCUMENT_POSITION_CONTAINS: Short
JS
1.1

DOCUMENT_POSITION_DISCONNECTED

val DOCUMENT_POSITION_DISCONNECTED: Short
JS
1.1

DOCUMENT_POSITION_FOLLOWING

val DOCUMENT_POSITION_FOLLOWING: Short
JS
1.1

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
JS
1.1

DOCUMENT_POSITION_PRECEDING

val DOCUMENT_POSITION_PRECEDING: Short
JS
1.1

DOCUMENT_TYPE_NODE

val DOCUMENT_TYPE_NODE: Short
JS
1.1

ELEMENT_NODE

val ELEMENT_NODE: Short
JS
1.1

ENTITY_NODE

val ENTITY_NODE: Short
JS
1.1

ENTITY_REFERENCE_NODE

val ENTITY_REFERENCE_NODE: Short
JS
1.1

NOTATION_NODE

val NOTATION_NODE: Short
JS
1.1

PROCESSING_INSTRUCTION_NODE

val PROCESSING_INSTRUCTION_NODE: Short
JS
1.1

TEXT_NODE

val TEXT_NODE: Short

Extension Properties

JS
1.1

isElement

Gets a value indicating whether this node is an Element.

val Node.isElement: Boolean
JS
1.1

isText

Gets a value indicating whether this node is a TEXT_NODE or a CDATA_SECTION_NODE.

val Node.isText: Boolean

Extension Functions

JS
1.1

addClass

Adds CSS class to element. Has no effect if all specified classes are already in class attribute of the element

fun Element.addClass(vararg cssClasses: String): Boolean
JS
1.1

appendElement

Appends a newly created element with the specified name to this element.

fun Element.appendElement(
    name: String,
    init: Element.() -> Unit
): Element
JS
1.1

appendText

Creates text node and append it to the element.

fun Element.appendText(text: String): Element
JS
1.1

clear

Removes all the children from this node.

fun Node.clear()
JS
1.1

hasClass

Returns true if the element has the given CSS class style in its 'class' attribute

fun Element.hasClass(cssClass: String): Boolean
JS
1.1

removeClass

Removes all cssClasses from element. Has no effect if all specified classes are missing in class attribute of the element

fun Element.removeClass(vararg cssClasses: String): Boolean

Inheritors

JS
1.1

HTMLElement

Exposes the JavaScript HTMLElement to Kotlin

abstract class HTMLElement : 
    Element,
    GlobalEventHandlers,
    DocumentAndElementEventHandlers,
    ElementContentEditable,
    ElementCSSInlineStyle
JS
1.1

SVGElement

Exposes the JavaScript SVGElement to Kotlin

abstract class SVGElement : 
    Element,
    ElementCSSInlineStyle,
    GlobalEventHandlers,
    SVGElementInstance