Node

abstract external class Node : EventTarget (source)

Platform and version requirements: JS

Exposes the JavaScript Node to Kotlin

Constructors

<init>

Node()

Exposes the JavaScript Node to Kotlin

Properties

baseURI

open val baseURI: String

childNodes

open val childNodes: NodeList

firstChild

open val firstChild: Node?

isConnected

open val isConnected: Boolean

lastChild

open val lastChild: Node?

nextSibling

open val nextSibling: Node?

nodeName

open val nodeName: String

nodeType

open val nodeType: Short

nodeValue

open var nodeValue: String?

ownerDocument

open val ownerDocument: Document?

parentElement

open val parentElement: Element?

parentNode

open val parentNode: Node?

previousSibling

open val previousSibling: Node?

textContent

open var textContent: String?

Functions

appendChild

fun appendChild(node: Node): Node

cloneNode

fun cloneNode(deep: Boolean = definedExternally): Node

compareDocumentPosition

fun compareDocumentPosition(other: Node): Short

contains

fun contains(other: Node?): Boolean

getRootNode

fun getRootNode(
    options: GetRootNodeOptions = definedExternally
): Node

hasChildNodes

fun hasChildNodes(): Boolean

insertBefore

fun insertBefore(node: Node, child: Node?): Node

isDefaultNamespace

fun isDefaultNamespace(namespace: String?): Boolean

isEqualNode

fun isEqualNode(otherNode: Node?): Boolean

isSameNode

fun isSameNode(otherNode: Node?): Boolean

lookupNamespaceURI

fun lookupNamespaceURI(prefix: String?): String?

lookupPrefix

fun lookupPrefix(namespace: String?): String?

normalize

fun normalize()

removeChild

fun removeChild(child: Node): Node

replaceChild

fun replaceChild(node: Node, child: Node): Node

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

dispatchEvent

fun dispatchEvent(event: Event): Boolean

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

Companion Object Properties

ATTRIBUTE_NODE

val ATTRIBUTE_NODE: Short

CDATA_SECTION_NODE

val CDATA_SECTION_NODE: Short

COMMENT_NODE

val COMMENT_NODE: Short

DOCUMENT_FRAGMENT_NODE

val DOCUMENT_FRAGMENT_NODE: Short

DOCUMENT_NODE

val DOCUMENT_NODE: Short

DOCUMENT_POSITION_CONTAINED_BY

val DOCUMENT_POSITION_CONTAINED_BY: Short

DOCUMENT_POSITION_CONTAINS

val DOCUMENT_POSITION_CONTAINS: Short

DOCUMENT_POSITION_DISCONNECTED

val DOCUMENT_POSITION_DISCONNECTED: Short

DOCUMENT_POSITION_FOLLOWING

val DOCUMENT_POSITION_FOLLOWING: Short

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short

DOCUMENT_POSITION_PRECEDING

val DOCUMENT_POSITION_PRECEDING: Short

DOCUMENT_TYPE_NODE

val DOCUMENT_TYPE_NODE: Short

ELEMENT_NODE

val ELEMENT_NODE: Short

ENTITY_NODE

val ENTITY_NODE: Short

ENTITY_REFERENCE_NODE

val ENTITY_REFERENCE_NODE: Short

NOTATION_NODE

val NOTATION_NODE: Short

PROCESSING_INSTRUCTION_NODE

val PROCESSING_INSTRUCTION_NODE: Short

TEXT_NODE

val TEXT_NODE: Short

Extension Properties

isElement

val Node.isElement: Boolean

Gets a value indicating whether this node is an Element.

isText

val Node.isText: Boolean

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

Extension Functions

clear

fun Node.clear()

Removes all the children from this node.

Inheritors

Attr

abstract external class Attr : Node

Exposes the JavaScript Attr to Kotlin

CharacterData

abstract external class CharacterData : 
    Node,
    NonDocumentTypeChildNode,
    ChildNode

Exposes the JavaScript CharacterData to Kotlin

Document

open external class Document : 
    Node,
    GlobalEventHandlers,
    DocumentAndElementEventHandlers,
    NonElementParentNode,
    DocumentOrShadowRoot,
    ParentNode,
    GeometryUtils

Exposes the JavaScript Document to Kotlin

DocumentFragment

open external class DocumentFragment : 
    Node,
    NonElementParentNode,
    ParentNode

Exposes the JavaScript DocumentFragment to Kotlin

DocumentType

abstract external class DocumentType : Node, ChildNode

Exposes the JavaScript DocumentType to Kotlin

Element

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

Exposes the JavaScript Element to Kotlin