The Document interface represents any web page loaded in the browser and serves as an entry point into the
web page's content, which is the DOM tree. The DOM tree includes elements such as <body> and
, among
many others. It provides functionality global to the document, like how to obtain the page's URL and create
new elements in the document.
Add a new node (and its subtree, if applicable) to the end of the list of children of this node.
Add a new node (and its subtree, if applicable) to the end of the list of children of this node.
If the new child is already present in the DOM tree it is first removed (effectively moving it).
If the new child is a DocumentFragment node then the entire contents of the document fragment
are appended, but the fragment node itself is not (therefore using a document fragment is a good
way of building and attaching several nodes at once).
node
The new node to be added to this node. If the new node has any children these are also
added recursively, preserving the new node's sub-tree.
The attributes collection is an unordered list of all the effective attributes1 of an Element;
for other nodes this property is null.
The attributes collection is an unordered list of all the effective attributes1 of an Element;
for other nodes this property is null.
This collection is a NamedNodeMap, primarily intended to be accessed by name. It's also possible
to access the items by their index in the map, however the DOM does not specify what order they
will appear in (and this varies by browser, as noted in the Compatibility notes below).
As with all named node maps, attributes is a live collection, which means that changes to the
collection it represents are immediately reflected in the node map (as opposed to it being a static snapshot).
This collection is read-only.
The childNodes collection is an ordered list of all the direct child nodes of this node; if there are
no child nodes then this collection is empty (it has zero length).
The childNodes collection is an ordered list of all the direct child nodes of this node; if there are
no child nodes then this collection is empty (it has zero length). The childNodes collection is a
NodeList, in which the items are indexed numerically, and appear in source order.
As with all node lists, childNodes is a live collection, which means that changes to the collection
it represents are immediately reflected in the node list (as opposed to it being a static snapshot).
Attributes of an element are not considered child nodes, and therefore don’t appear in the childNodes collection2
This collection is read only.
returns
an ordered list of all the direct child nodes of this node
Creates a duplicate of this node, including all attributes and their values (including attributes
which are not explicitly defined but which have a default value in this document type).
Creates a duplicate of this node, including all attributes and their values (including attributes
which are not explicitly defined but which have a default value in this document type). The duplicate
node has no parent (parentNode is null) until it's added to the document, for example using appendChild.
If the deep argument is included and has the value true then the node's sub-tree (if any) will also be duplicated.
Cloning a sub-tree that is readonly results in a sub-tree that can be modified (ie. the sub-tree of a cloned node
is always mutable, even if the original was immutable), with the exception that the children of a cloned
EntityReference are always readonly.
Cloning an Element node also copies its attributes (including any default attributes), but does not copy its
text unless the deep argument is true.
Cloning an Attr node directly (as opposed to attributes that belong to a cloned Element) creates a node for
which the specified property is true.
Whether a Document, DocumentType, Entity or Notation node may be cloned is not defined by the DOM, and depends
on the implementation (see Compatibility notes below).
deep
If true duplicate the node's sub-tree as well as the node itself. If false only copy
the node (and its attributes, if it's an Element).
The EntityReference interface inherits from Node, and represents an unexpanded entity
reference (eg.
The EntityReference interface inherits from Node, and represents an unexpanded entity
reference (eg. amp). EntityReference nodes may appear in the DOM when an entity reference
appears in the source document, or when inserting new entity references. Entity nodes
themselves are readonly, so the EntityReference interface is used to create or modify them.
The DOM does not require an implementation to expand external entities, hence the replacement
value of an entity reference may not be available; if it is available it will appear in the
childNodes collection of the EntityReference.
Conversely, an implementation may choose to expand all entities before building the DOM tree,
in which case there will be no EntityReference nodes in the document at all, only Entity nodes.
In practise, this is what happens in all tested browsers.
The first node that is a direct child of this node (ie.
The first node that is a direct child of this node (ie. this node is its parent and it appears at the
beginning of the childNodes collection), or null if there is no such node.
This property is readonly.
returns
The first node that is a direct child of this node
Insert a new node as a child of this node, directly before an existing child of this node, or at the
end of the list of children if no existing child is specified or it's null.
Insert a new node as a child of this node, directly before an existing child of this node, or at the
end of the list of children if no existing child is specified or it's null. If the new child is already
present in the DOM tree it is first removed (effectively moving it).
newNode
The new node to insert.
existingChild
An existing child node that the new node should be inserted before.
If this argument is null, the new node is inserted at the end of this node's list of children.
Test whether a specific feature of the DOM is implemented, and supported by this node.
Test whether a specific feature of the DOM is implemented, and supported by this node.
This method is essentially the same as hasFeature, except that it's concerned with whether a feature is supported
by a specific node, rather than whether it's implemented in general.
feature
The name of the feature to test, using one of the values defined in the DOM 2 Conformance list.
version
The DOM version to test. For DOM 2 this is always the value 2.0. If this argument is not specified,
the method will return true if the feature is supported at any DOM level.
returns
true if the feature is implemented and supported on this node, otherwise false
The last node that is a direct child of this node (ie.
The last node that is a direct child of this node (ie. this node is its parent and it appears at the end
of the childNodes collection), or null if there is no such node.
This property is readonly.
The local name (ie. not including any namespace prefix) of a Element or Attr node; for other
nodes this property is null.
DOM 1 methods such as getAttribute are not namespace aware, and identify nodes by their nodeName.
Namespace aware DOM 2 methods such as getAttributeNS identify nodes by a combination of their
namespaceURI and localName; the localName and prefix combined form a qualified name — a name
which comprises the namespace prefix then the local name, delimited with a colon.
This property is readonly.
The namespace URI of an Element or Attr node. For other nodes, or elements or attributes created with a
DOM 1 method that isn't namespace aware (such as createElement), or nodes with no namespace, this property is null.
This should not be a computed value or lookup of the namespace an element should have, it should be the literal
value that it does have.
An Element node can inherit its namespace from an ancestor. However Attr nodes do not inherit a namespace from
the element they're attached to — if an attribute does not have an explicitly defined namespace then it simply
has no namespace.
This property is readonly.
The node immediately after this node (ie. both nodes have the same parent and are next to each other in
its childNodes collection), or null if there is no such node.
This property is readonly.
The Document which contains this node; or null if this node is itself a Document, or a
DocumentType that is not associated with any document.
The Document which contains this node; or null if this node is itself a Document, or a
DocumentType that is not associated with any document.
This property is read-only.
The parent of this node; or null if it has no parent.
The parent of this node; or null if it has no parent.
Nodes which have just been created but not added to the document, or have just been removed
from the document, or are Attr, Document, DocumentFragment or Entity nodes, do not have a parent.
This property is readonly.
The namespace prefix of this node; or null if this node has no namespace.
The namespace prefix of this node; or null if this node has no namespace.
Only namespaced elements and attributes have a prefix; for other nodes, or for
elements or attributes created with a non-namespace-aware method such as createElement,
the prefix property is null.
Changing this value may also change the nodeName of this node (since the node name of a
namespaced node is a combination of of localName and prefix), as well as the tagName and
name properties of elements and attributes (respectively).
Changing the prefix of an element or attribute that has a default value in this document
type does not cause a new default node to be created (ie. the prefix change might mean
that the default is no longer present, but a new default will not appear to replace it).
This property is read/write.
The node immediately before this node (ie. both nodes have the same parent and are next
to each other in its childNodes collection), or null if there is no such node.
This property is readonly.
Returns a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
Returns a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
returns
a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
defreadyState: String
Returns the (loading) status of the document
Returns the (loading) status of the document
returns
the (loading) status of the document
One of five values:
uninitialized - Has not started loading yet
loading - Is loading
loaded - Has been loaded
interactive - Has loaded enough and the user can interact with it
complete - Fully loaded
defreferrer: String
Returns the URL of the document that loaded the current document
Returns the URL of the document that loaded the current document
returns
the URL of the document that loaded the current document
defremoveEventListener(event: String, function: Function, useCapture: Boolean = false): Unit
Removes an event handler from the document (that has been attached with the addEventListener() method)
Removes an event handler from the document (that has been attached with the addEventListener() method)
event
Required. A String that specifies the name of the event to remove.
function
Required. Specifies the function to remove.
useCapture
Optional. A Boolean value that specifies the event phase to remove the event handler from.
Possible values:
true - Removes the event handler from the capturing phase
false - Default. Removes the event handler from the bubbling phase
Replace an existing child of this node with a new child node.
Replace an existing child of this node with a new child node. If the new child is already present
in the DOM tree it is first removed (effectively moving it).
The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as <body> and
http://www.w3schools.com/jsref/dom_obj_document.asp
https://developer.mozilla.org/en-US/docs/Web/API/Document
Value Members
final def !=(arg0: Any): Boolean
final def ##(): Int
final def ==(arg0: Any): Boolean
def URL: String
Returns the full URL of the HTML document
Returns the full URL of the HTML document
the full URL of the HTML document
def activeElement: Element
Returns the currently focused element in the document
Returns the currently focused element in the document
the currently focused element in the document
def addEventListener(event: String, callback: Function): Unit
Attaches an event handler to the document
Attaches an event handler to the document
the event
the callback function
def adoptNode(element: Element): Unit
Adopts a node from another document
def anchors: HTMLCollection[HTMLAnchorElement]
Returns a collection of all elements in the document that have a name attribute
Returns a collection of all elements in the document that have a name attribute
a collection of all elements in the document that have a name attribute
def animationend(callback: Function): Unit
The event occurs when a CSS animation has completed
The event occurs when a CSS animation has completed
def animationiteration(callback: Function): Unit
The event occurs when a CSS animation is repeated
The event occurs when a CSS animation is repeated
def animationstart(callback: Function): Unit
The event occurs when a CSS animation has started
The event occurs when a CSS animation has started
def append(nodes: |[Node, String]*): Document.this.type
Inserts a set of Node objects or DOMString objects after the last child of the ParentNode.
Inserts a set of Node objects or DOMString objects after the last child of the ParentNode. DOMString objects are inserted as equivalent Text nodes.
A set of Node or DOMString objects to insert.
def appendChild(node: Node): Node
Add a new node (and its subtree, if applicable) to the end of the list of children of this node.
Add a new node (and its subtree, if applicable) to the end of the list of children of this node.
If the new child is already present in the DOM tree it is first removed (effectively moving it). If the new child is a DocumentFragment node then the entire contents of the document fragment are appended, but the fragment node itself is not (therefore using a document fragment is a good way of building and attaching several nodes at once).
The new node to be added to this node. If the new node has any children these are also added recursively, preserving the new node's sub-tree.
The node that was added
def applets: HTMLCollection[HTMLAppletElement]
Returns a collection of all <applet> elements in the document
Returns a collection of all <applet> elements in the document
a collection of all <applet> elements in the document
final def asInstanceOf[T0]: T0
def attributes: NamedNodeMap[Attr]
The attributes collection is an unordered list of all the effective attributes1 of an Element; for other nodes this property is null.
The attributes collection is an unordered list of all the effective attributes1 of an Element; for other nodes this property is null.
This collection is a NamedNodeMap, primarily intended to be accessed by name. It's also possible to access the items by their index in the map, however the DOM does not specify what order they will appear in (and this varies by browser, as noted in the Compatibility notes below).
As with all named node maps, attributes is a live collection, which means that changes to the collection it represents are immediately reflected in the node map (as opposed to it being a static snapshot). This collection is read-only.
def baseURI: String
Returns the absolute base URI of a document
Returns the absolute base URI of a document
the absolute base URI of a document
var body: HTMLBodyElement
Sets or returns the document's body (the <body> element)
Sets or returns the document's body (the <body> element)
the document's body
def childElementCount: UnsignedLong
Returns an unsigned long giving the amount of children that the object has.
Returns an unsigned long giving the amount of children that the object has.
def childNodes[T <: Node]: NodeList[T]
The childNodes collection is an ordered list of all the direct child nodes of this node; if there are no child nodes then this collection is empty (it has zero length).
The childNodes collection is an ordered list of all the direct child nodes of this node; if there are no child nodes then this collection is empty (it has zero length). The childNodes collection is a NodeList, in which the items are indexed numerically, and appear in source order.
As with all node lists, childNodes is a live collection, which means that changes to the collection it represents are immediately reflected in the node list (as opposed to it being a static snapshot).
Attributes of an element are not considered child nodes, and therefore don’t appear in the childNodes collection2 This collection is read only.
an ordered list of all the direct child nodes of this node
def children: HTMLCollection[Element]
Returns a live HTMLCollection containing all objects of type Element that are children of this ParentNode.
Returns a live HTMLCollection containing all objects of type Element that are children of this ParentNode.
def clone(): AnyRef
def cloneNode(deep: Boolean): Document.this.type
Creates a duplicate of this node, including all attributes and their values (including attributes which are not explicitly defined but which have a default value in this document type).
Creates a duplicate of this node, including all attributes and their values (including attributes which are not explicitly defined but which have a default value in this document type). The duplicate node has no parent (parentNode is null) until it's added to the document, for example using appendChild.
If the deep argument is included and has the value true then the node's sub-tree (if any) will also be duplicated.
Cloning a sub-tree that is readonly results in a sub-tree that can be modified (ie. the sub-tree of a cloned node is always mutable, even if the original was immutable), with the exception that the children of a cloned EntityReference are always readonly.
Cloning an Element node also copies its attributes (including any default attributes), but does not copy its text unless the deep argument is true.
Cloning an Attr node directly (as opposed to attributes that belong to a cloned Element) creates a node for which the specified property is true.
Whether a Document, DocumentType, Entity or Notation node may be cloned is not defined by the DOM, and depends on the implementation (see Compatibility notes below).
If true duplicate the node's sub-tree as well as the node itself. If false only copy the node (and its attributes, if it's an Element).
The duplicate node.
def close(): Unit
Closes the output stream previously opened with Document#open()
var cookie: String
Returns all name/value pairs of cookies in the document
Returns all name/value pairs of cookies in the document
all name/value pairs of cookies in the document
def createAttribute(name: String): Unit
Creates an attribute node
def createComment(text: String): Comment
Creates a Comment node with the specified text
def createDocumentFragment(): DocumentFragment
Creates an empty DocumentFragment node
def createElement[T <: Element](type: String): T
Creates an Element node
Creates an Element node
a new element
def createEntityReference(name: String): EntityReference
The EntityReference interface inherits from Node, and represents an unexpanded entity reference (eg.
The EntityReference interface inherits from Node, and represents an unexpanded entity reference (eg. amp). EntityReference nodes may appear in the DOM when an entity reference appears in the source document, or when inserting new entity references. Entity nodes themselves are readonly, so the EntityReference interface is used to create or modify them.
The DOM does not require an implementation to expand external entities, hence the replacement value of an entity reference may not be available; if it is available it will appear in the childNodes collection of the EntityReference.
Conversely, an implementation may choose to expand all entities before building the DOM tree, in which case there will be no EntityReference nodes in the document at all, only Entity nodes. In practise, this is what happens in all tested browsers.
An EntityReference node can have Element, ProcessingInstruction, Comment, Text, CDATASection and other EntityReference nodes as children.
the name of the entity
an EntityReference
def createTextNode(text: String): Element
Creates a Text node
Creates a Text node
the given text
a new text node
def doctype: DocumentType
Returns the Document Type Declaration associated with the document
Returns the Document Type Declaration associated with the document
the Document Type Declaration associated with the document
def documentElement: HTMLElement
Returns the Document Element of the document (the <html> element)
Returns the Document Element of the document (the <html> element)
the Document Element of the document (the <html> element)
def documentMode: String
Returns the mode used by the browser to render the document
Returns the mode used by the browser to render the document
the mode used by the browser to render the document
var documentURI: String
Sets or returns the location of the document
def domConfig: String
Obsolete.
Obsolete. Returns the DOM configuration of the document
the DOM configuration of the document
def domain: String
Returns the domain name of the server that loaded the document
Returns the domain name of the server that loaded the document
the domain name of the server that loaded the document
def embeds: HTMLCollection[HTMLEmbedElement]
Returns a collection of all <embed> elements the document
Returns a collection of all <embed> elements the document
a collection of all <embed> elements the document
final def eq(arg0: AnyRef): Boolean
def equals(arg0: Any): Boolean
def finalize(): Unit
def firstChild[T <: Node]: T
The first node that is a direct child of this node (ie.
The first node that is a direct child of this node (ie. this node is its parent and it appears at the beginning of the childNodes collection), or null if there is no such node. This property is readonly.
The first node that is a direct child of this node
def firstElementChild: Element
Returns the Element that is the first child of this ParentNode, or null if there is none.
Returns the Element that is the first child of this ParentNode, or null if there is none.
def forms: HTMLCollection[HTMLFormElement]
Returns a collection of all
Returns a collection of all
a collection of all
final def getClass(): Class[_]
def getElementById[T <: Element](id: String): T
Returns the element that has the ID attribute with the specified value
Returns the element that has the ID attribute with the specified value
the ID attribute
the element that has the ID attribute
def getElementsByClassName(className: String): HTMLCollection[Element]
Returns a HTMLCollection containing all elements with the specified class name
Returns a HTMLCollection containing all elements with the specified class name
the specified class name
a HTMLCollection of elements
def getElementsByName(name: String): HTMLCollection[Element]
Returns a HTMLCollection containing all elements with a specified name
Returns a HTMLCollection containing all elements with a specified name
the specified name
a HTMLCollection of elements
def getElementsByTagName(tagName: String): HTMLCollection[Element]
Returns a HTMLCollection containing all elements with the specified tag name
Returns a HTMLCollection containing all elements with the specified tag name
the specified tag name
a HTMLCollection of elements
def hasAttributes(): Boolean
Returns whether an Element node has any attributes.
Returns whether an Element node has any attributes.
true if this node is an Element and has any effective attributes, otherwise false
def hasChildNodes(): Boolean
Test whether a node has any child nodes; equivalent to evaluating whether the childNodes collection has a length greater than zero.
Test whether a node has any child nodes; equivalent to evaluating whether the childNodes collection has a length greater than zero.
true if this node has any children, otherwise false
def hasFocus(): Boolean
Returns a Boolean value indicating whether the document has focus
Returns a Boolean value indicating whether the document has focus
a Boolean value indicating whether the document has focus
def hasOwnProperty(v: String): Boolean
def hashCode(): Int
def head: HTMLHeadElement
Returns the <head> element of the document
Returns the <head> element of the document
the <head> element of the document
def images: HTMLCollection[Image]
Returns a collection of all elements in the document
Returns a collection of all elements in the document
a collection of all elements in the document
def implementation: DocumentImplementation
The implementation property returns the DOMimplementation object that handles this document, as a DocumentImplementation object.
def importNode(node: Element, deep: Boolean): Element
Imports a node from another document
Imports a node from another document
Required. The node from another document. Can be of any node type
Required. If set to false, only the node itself is imported, if set to true, all child nodes (descendants) are also imported
A Node object, representing the imported node
def inputEncoding: String
Returns the encoding, character set, used for the document
Returns the encoding, character set, used for the document
the encoding, character set, used for the document
def insertBefore(newNode: Node, existingChild: Node): Node
Insert a new node as a child of this node, directly before an existing child of this node, or at the end of the list of children if no existing child is specified or it's null.
Insert a new node as a child of this node, directly before an existing child of this node, or at the end of the list of children if no existing child is specified or it's null. If the new child is already present in the DOM tree it is first removed (effectively moving it).
The new node to insert.
An existing child node that the new node should be inserted before. If this argument is null, the new node is inserted at the end of this node's list of children.
the inserted node
final def isInstanceOf[T0]: Boolean
def isPrototypeOf(v: Object): Boolean
def isSupported(feature: String, version: String = js.native): Boolean
Test whether a specific feature of the DOM is implemented, and supported by this node.
Test whether a specific feature of the DOM is implemented, and supported by this node.
This method is essentially the same as hasFeature, except that it's concerned with whether a feature is supported by a specific node, rather than whether it's implemented in general.
The name of the feature to test, using one of the values defined in the DOM 2 Conformance list.
The DOM version to test. For DOM 2 this is always the value 2.0. If this argument is not specified, the method will return true if the feature is supported at any DOM level.
true if the feature is implemented and supported on this node, otherwise false
def lastChild: Node
The last node that is a direct child of this node (ie.
The last node that is a direct child of this node (ie. this node is its parent and it appears at the end of the childNodes collection), or null if there is no such node. This property is readonly.
The last node that is a direct child of this node
def lastElementChild: Element
Returns the Element that is the last child of this ParentNode, or null if there is none.
Returns the Element that is the last child of this ParentNode, or null if there is none.
def lastModified: Double
Returns the date and time the document was last modified
Returns the date and time the document was last modified
the date and time the document was last modified
def links: HTMLCollection[HTMLAnchorElement]
Returns a collection of all and elements in the document that have a href attribute
Returns a collection of all and elements in the document that have a href attribute
a collection of all and elements in the document that have a href attribute
def localName: String
The local name (ie.
The local name (ie. not including any namespace prefix) of a Element or Attr node; for other nodes this property is null.
DOM 1 methods such as getAttribute are not namespace aware, and identify nodes by their nodeName. Namespace aware DOM 2 methods such as getAttributeNS identify nodes by a combination of their namespaceURI and localName; the localName and prefix combined form a qualified name — a name which comprises the namespace prefix then the local name, delimited with a colon. This property is readonly.
The local name
def namespaceURI: String
The namespace URI of an Element or Attr node.
The namespace URI of an Element or Attr node. For other nodes, or elements or attributes created with a DOM 1 method that isn't namespace aware (such as createElement), or nodes with no namespace, this property is null.
This should not be a computed value or lookup of the namespace an element should have, it should be the literal value that it does have.
An Element node can inherit its namespace from an ancestor. However Attr nodes do not inherit a namespace from the element they're attached to — if an attribute does not have an explicitly defined namespace then it simply has no namespace. This property is readonly.
The namespace URI
final def ne(arg0: AnyRef): Boolean
def nextSibling: Node
The node immediately after this node (ie.
The node immediately after this node (ie. both nodes have the same parent and are next to each other in its childNodes collection), or null if there is no such node. This property is readonly.
The node immediately after this node
def nodeName: String
The name of this node
The name of this node
def nodeType: NodeType
A numeric code that represents the type of this node +---------------------------+----+ | Element | 1 | | Attr | 2 | | Text | 3 | | CDATASection | 4 | | EntityReference | 5 | | Entity | 6 | | ProcessingInstruction | 7 | | Comment | 8 | | Document | 9 | | DocumentType | 10 | | DocumentFragment | 11 | | Notation | 12 | +---------------------------+----+
A numeric code that represents the type of this node +---------------------------+----+ | Element | 1 | | Attr | 2 | | Text | 3 | | CDATASection | 4 | | EntityReference | 5 | | Entity | 6 | | ProcessingInstruction | 7 | | Comment | 8 | | Document | 9 | | DocumentType | 10 | | DocumentFragment | 11 | | Notation | 12 | +---------------------------+----+
the numeric code
NodeTypes
def nodeValue: Any
The value of this node
The value of this node
def normalize(): Unit
Removes empty Text nodes, and joins adjacent nodes
Removes empty Text nodes, and joins adjacent nodes
def normalizeDocument(): Unit
Removes empty Text nodes, and joins adjacent nodes
final def notify(): Unit
final def notifyAll(): Unit
def onabort(callback: Function): Unit
The event occurs when the loading of a resource has been aborted
The event occurs when the loading of a resource has been aborted
def onafterprint(callback: Function): Unit
The event occurs when a page has started printing, or if the print dialogue box has been closed
The event occurs when a page has started printing, or if the print dialogue box has been closed
def onbeforeprint(callback: Function): Unit
The event occurs when a page is about to be printed
The event occurs when a page is about to be printed
def onbeforeunload(callback: Function): Unit
The event occurs before the document is about to be unloaded
The event occurs before the document is about to be unloaded
def onblur(callback: Function): Unit
The event occurs when an element loses focus
The event occurs when an element loses focus
def onchange(callback: Function): Unit
The event occurs when the content of a form element, the selection, or the checked state have changed (for ,,
The event occurs when the content of a form element, the selection, or the checked state have changed (for ,,
def oncopy(callback: Function): Unit
The event occurs when the user copies the content of an element
The event occurs when the user copies the content of an element
def oncut(callback: Function): Unit
The event occurs when the user cuts the content of an element
The event occurs when the user cuts the content of an element
def ondrag(callback: Function): Unit
The event occurs when an element is being dragged
The event occurs when an element is being dragged
def ondragend(callback: Function): Unit
The event occurs when the user has finished dragging an element
The event occurs when the user has finished dragging an element
def ondragenter(callback: Function): Unit
The event occurs when the dragged element enters the drop target
The event occurs when the dragged element enters the drop target
def ondragleave(callback: Function): Unit
The event occurs when the dragged element leaves the drop target
The event occurs when the dragged element leaves the drop target
def ondragover(callback: Function): Unit
The event occurs when the dragged element is over the drop target
The event occurs when the dragged element is over the drop target
def ondragstart(callback: Function): Unit
The event occurs when the user starts to drag an element
The event occurs when the user starts to drag an element
def ondrop(callback: Function): Unit
The event occurs when the dragged element is dropped on the drop target
The event occurs when the dragged element is dropped on the drop target
def onerror(callback: Function): Unit
The event occurs when an error occurs while loading an external file
The event occurs when an error occurs while loading an external file
def onfocus(callback: Function): Unit
The event occurs when an element gets focus
The event occurs when an element gets focus
def onfocusin(callback: Function): Unit
The event occurs when an element is about to get focus
The event occurs when an element is about to get focus
def onfocusout(callback: Function): Unit
The event occurs when an element is about to lose focus
The event occurs when an element is about to lose focus
def onhashchange(callback: Function): Unit
The event occurs when there has been changes to the anchor part of a URL
The event occurs when there has been changes to the anchor part of a URL
def oninput(callback: Function): Unit
The event occurs when an element gets user input
The event occurs when an element gets user input
def oninvalid(callback: Function): Unit
The event occurs when an element is invalid
The event occurs when an element is invalid
def onkeydown(callback: Function): Unit
The event occurs when the user is pressing a key
The event occurs when the user is pressing a key
def onkeypress(callback: Function): Unit
The event occurs when the user presses a key
The event occurs when the user presses a key
def onkeyup(callback: Function): Unit
The event occurs when the user releases a key
The event occurs when the user releases a key
def onload(callback: Function): Unit
The event occurs when an object has loaded
The event occurs when an object has loaded
def onmessage(callback: Function): Unit
The event occurs when a message is received through the event source
The event occurs when a message is received through the event source
def onmousewheel(callback: Function): Unit
Deprecated.
Deprecated. Use the onwheel event instead
def onoffline(callback: Function): Unit
The event occurs when the browser starts to work offline
The event occurs when the browser starts to work offline
def ononline(callback: Function): Unit
The event occurs when the browser starts to work online
The event occurs when the browser starts to work online
def onopen(callback: Function): Unit
The event occurs when a connection with the event source is opened
The event occurs when a connection with the event source is opened
def onpagehide(callback: Function): Unit
The event occurs when the user navigates away from a webpage
The event occurs when the user navigates away from a webpage
def onpageshow(callback: Function): Unit
The event occurs when the user navigates to a webpage
The event occurs when the user navigates to a webpage
def onpaste(callback: Function): Unit
The event occurs when the user pastes some content in an element
The event occurs when the user pastes some content in an element
def onpopstate(callback: Function): Unit
The event occurs when the window's history changes
The event occurs when the window's history changes
def onreset(callback: Function): Unit
The event occurs when a form is reset
The event occurs when a form is reset
def onresize(callback: Function): Unit
The event occurs when the document view is resized
The event occurs when the document view is resized
def onscroll(callback: Function): Unit
The event occurs when an element's scrollbar is being scrolled
The event occurs when an element's scrollbar is being scrolled
def onsearch(callback: Function): Unit
The event occurs when the user writes something in a search field (for <input="search">)
The event occurs when the user writes something in a search field (for <input="search">)
def onselect(callback: Function): Unit
The event occurs after the user selects some text (for and
The event occurs after the user selects some text (for and
def onshow(callback: Function): Unit
The event occurs when a <menu> element is shown as a context menu
The event occurs when a <menu> element is shown as a context menu
def onstorage(callback: Function): Unit
The event occurs when a Web Storage area is updated
The event occurs when a Web Storage area is updated
def onsubmit(callback: Function): Unit
The event occurs when a form is submitted
The event occurs when a form is submitted
def ontoggle(callback: Function): Unit
The event occurs when the user opens or closes the <details> element
The event occurs when the user opens or closes the <details> element
def ontouchcancel(callback: Function): Unit
The event occurs when the touch is interrupted
The event occurs when the touch is interrupted
def ontouchend(callback: Function): Unit
The event occurs when a finger is removed from a touch screen
The event occurs when a finger is removed from a touch screen
def ontouchmove(callback: Function): Unit
The event occurs when a finger is dragged across the screen
The event occurs when a finger is dragged across the screen
def ontouchstart(callback: Function): Unit
The event occurs when a finger is placed on a touch screen
The event occurs when a finger is placed on a touch screen
def onunload(callback: Function): Unit
The event occurs once a page has unloaded (for <body>)
The event occurs once a page has unloaded (for <body>)
def onwheel(callback: Function): Unit
The event occurs when the mouse wheel rolls up or down over an element
The event occurs when the mouse wheel rolls up or down over an element
def open(): Unit
Opens an HTML output stream to collect output from document.write()
def ownerDocument: Document
The Document which contains this node; or null if this node is itself a Document, or a DocumentType that is not associated with any document.
The Document which contains this node; or null if this node is itself a Document, or a DocumentType that is not associated with any document. This property is read-only.
def parentNode: Node
The parent of this node; or null if it has no parent.
The parent of this node; or null if it has no parent.
Nodes which have just been created but not added to the document, or have just been removed from the document, or are Attr, Document, DocumentFragment or Entity nodes, do not have a parent. This property is readonly.
def prefix: String
The namespace prefix of this node; or null if this node has no namespace.
The namespace prefix of this node; or null if this node has no namespace.
Only namespaced elements and attributes have a prefix; for other nodes, or for elements or attributes created with a non-namespace-aware method such as createElement, the prefix property is null.
Changing this value may also change the nodeName of this node (since the node name of a namespaced node is a combination of of localName and prefix), as well as the tagName and name properties of elements and attributes (respectively).
Changing the prefix of an element or attribute that has a default value in this document type does not cause a new default node to be created (ie. the prefix change might mean that the default is no longer present, but a new default will not appear to replace it). This property is read/write.
def prepend(nodes: |[Node, String]*): Document.this.type
Inserts a set of Node objects or DOMString objects before the first child of the ParentNode.
Inserts a set of Node objects or DOMString objects before the first child of the ParentNode. DOMString objects are inserted as equivalent Text nodes.
A set of Node or DOMString objects to insert.
def previousSibling: Node
The node immediately before this node (ie.
The node immediately before this node (ie. both nodes have the same parent and are next to each other in its childNodes collection), or null if there is no such node. This property is readonly.
def propertyIsEnumerable(v: String): Boolean
def querySelector(name: String): CSSSelector
Returns the first element that matches a specified CSS selector(s) in the document
Returns the first element that matches a specified CSS selector(s) in the document
the first element that matches a specified CSS selector(s) in the document
def querySelectorAll(): HTMLCollection[CSSSelector]
Returns a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
Returns a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
a static HTMLCollection containing all elements that matches a specified CSS selector(s) in the document
def readyState: String
Returns the (loading) status of the document
Returns the (loading) status of the document
the (loading) status of the document One of five values: uninitialized - Has not started loading yet loading - Is loading loaded - Has been loaded interactive - Has loaded enough and the user can interact with it complete - Fully loaded
def referrer: String
Returns the URL of the document that loaded the current document
Returns the URL of the document that loaded the current document
the URL of the document that loaded the current document
def removeChild(oldNode: Node): Unit
Removes a specified node from the children of this node.
Removes a specified node from the children of this node.
The node to be removed.
def removeEventListener(event: String, function: Function, useCapture: Boolean = false): Unit
Removes an event handler from the document (that has been attached with the addEventListener() method)
Removes an event handler from the document (that has been attached with the addEventListener() method)
Required. A String that specifies the name of the event to remove.
Required. Specifies the function to remove.
Optional. A Boolean value that specifies the event phase to remove the event handler from. Possible values: true - Removes the event handler from the capturing phase false - Default. Removes the event handler from the bubbling phase
def renameNode(node: Node, namespaceURI: String, nodename: String): Node
Renames the specified node.
Renames the specified node.
Node object Required. The node object you want to rename
String Required, but can be set to null if you do not want to specify the namespace URI of the node
String Required, the new nodename
A Node object, representing the renamed node
def replaceChild(newChild: Node, existingChild: Node): Node
Replace an existing child of this node with a new child node.
Replace an existing child of this node with a new child node. If the new child is already present in the DOM tree it is first removed (effectively moving it).
The node to be added.
The node to be removed and replaced.
The node that was removed
def scripts: HTMLCollection[ScriptElement]
Returns a collection of <script> elements in the document
Returns a collection of <script> elements in the document
a collection of <script> elements in the document
var strictErrorChecking: Boolean
Sets or returns whether error-checking is enforced or not
final def synchronized[T0](arg0: ⇒ T0): T0
var title: String
Sets or returns the title of the document
def toLocaleString(): String
def toString(): String
def valueOf(): Any
final def wait(): Unit
final def wait(arg0: Long, arg1: Int): Unit
final def wait(arg0: Long): Unit
def write(expr: Any*): Unit
Writes HTML expressions or JavaScript code to a document
def writeln(expr: Any*): Unit
Same as write(), but adds a newline character after each statement
Inherited from TouchEvents
Inherited from ServerSentEvents
Inherited from PrintEvents
Inherited from MiscEvents
Inherited from KeyboardEvents
Inherited from FrameObjectEvents
Inherited from FormEvents
Inherited from DragEvents
Inherited from ClipboardEvents
Inherited from AnimationEvents
Inherited from ParentNode
Inherited from Node
Inherited from Object
Inherited from Any
Inherited from AnyRef
Inherited from Any
Ungrouped