package dom
dom package object
- Alphabetic
- By Inheritance
- dom
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
Attr
extends Object with Node
The Attr interface inherits from Node and represents a single attribute of an Element node.
The Attr interface inherits from Node and represents a single attribute of an Element node.
However the Attr interface is a special case in terms of inheritance — attribute nodes are not child nodes of the element they belong to, and have no parent or sibling nodes, so although inherited Node properties such as parentNode and nextSibling are available, they always return null. Attributes are considered by the DOM to be properties of elements, rather than objects in their own right.
- Annotations
- @RawJSType() @native()
-
class
CDATASection
extends Text
The CDATASection interface inherits from CharacterData through Text, and represents a CDATA section in XML.
The CDATASection interface inherits from CharacterData through Text, and represents a CDATA section in XML.
CDATA sections are used to escape blocks of text that would otherwise be treated as markup. In web development they're often used for including unpredictable HTML inside another form of XML, or for programmatic code like scripts and style information.
A CDATASection node cannot have children.
- Annotations
- @RawJSType() @native()
-
trait
CharacterData
extends Object with Node
The CharacterData interface provides a set of properties and methods for working with text content (referred to as character data) in the DOM.
The CharacterData interface provides a set of properties and methods for working with text content (referred to as character data) in the DOM. This interface doesn't represent any actual object, but is inherited by other interfaces which do — Text, Comment and CDATASection.
- Annotations
- @RawJSType() @native()
- See also
http://reference.sitepoint.com/javascript/CharacterData/deleteData
-
class
Comment
extends Object with CharacterData
The Comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view.
The Comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. Comments are represented in HTML and XML as content between . In XML, the character sequence '--' cannot be used within a comment.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Comment
-
class
DOMError
extends Object
The DOMError interface describes an error object that contains an error name.
The DOMError interface describes an error object that contains an error name.
- Annotations
- @RawJSType() @native()
- See also
-
class
DOMHighResTimeStamp
extends Object
The DOMHighResTimeStamp type is a double and is used to store a time value.
The DOMHighResTimeStamp type is a double and is used to store a time value. The value could be a discrete point in time or the difference in time between two discrete points in time. The unit is milliseconds and should be accurate to 5 µs (microseconds). However, if the browser is unable to provide a time value accurate to 5 microseconds (due, for example, to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond.
- Annotations
- @RawJSType() @native() @JSName( "DOMHighResTimeStamp" )
- See also
https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp
-
implicit final
class
DOMHighResTimeStampEnrichment
extends AnyVal
DOMHighResTimeStamp Enrichment
-
trait
DOMImplementation
extends Object
The DOMImplementation interface provides methods for operations that are independent of any specific document or instance of the DOM.
The DOMImplementation interface provides methods for operations that are independent of any specific document or instance of the DOM.
DOMImplementation is not a node, hence it has no nodeName, nodeType or other properties of Node.
- Annotations
- @RawJSType() @native()
- type DOMString = String
-
trait
Document
extends Object with ParentNode with AnimationEvents with ClipboardEvents with DragEvents with FormEvents with FrameObjectEvents with KeyboardEvents with MiscEvents with PrintEvents with ServerSentEvents with TouchEvents
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 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.
- Annotations
- @RawJSType() @native()
- See also
http://www.w3schools.com/jsref/dom_obj_document.asp
https://developer.mozilla.org/en-US/docs/Web/API/Document
- trait DocumentFragment extends Object with ParentNode
The DocumentFragment interface inherits from Node, and is a lightweight version of the Document interface, intended for temporary storage of DOM structures.
The DocumentFragment interface inherits from Node, and is a lightweight version of the Document interface, intended for temporary storage of DOM structures. For example, it can be used as a temporary canvas for building a group of nodes, or to store a group of nodes while moving it from one part of a document to another.
Many node manipulation methods can take a document fragment as their argument (for example, appendChild), and this results in the fragment's entire sub-tree being appended, but not the DocumentFragment itself — a document fragment is a virtual construct, and never actually appears in a document.
A DocumentFragment node can have Element, ProcessingInstruction, Comment, Text, CDATASection and EntityReference nodes as children.
- Annotations
- @RawJSType() @native()
- class DocumentImplementation extends Object
Document Implementation
Document Implementation
- Annotations
- @RawJSType() @native()
- class DocumentType extends Object with Node
The DocumentType interface inherits from Node, and provides access to the attributes of a Document Type Declaration (DTD).
The DocumentType interface inherits from Node, and provides access to the attributes of a Document Type Declaration (DTD).
Every Document has a doctype property, which is a read-only instance of this interface where available, otherwise null. It should only return an object for an XML document that has a Document Type Declaration; for HTML documents, or XML documents without a DTD, it should be null.
A DocumentType node cannot have children.
- Annotations
- @RawJSType() @native()
- See also
http://reference.sitepoint.com/javascript/DocumentType/notations
https://developer.mozilla.org/en-US/docs/Web/API/DocumentType
- trait Element extends Object with ParentNode
The Element interface inherits from Node, and represents a single element in an HTML or XML document.
The Element interface inherits from Node, and represents a single element in an HTML or XML document.
An Element node may have other Element, Text, Comment, ProcessingInstruction, CDATASection or EntityReference nodes as children.
- Annotations
- @RawJSType() @native()
- trait Entity extends Object with Node
The Entity interface inherits from Node, and represents an expanded entity, ie.
The Entity interface inherits from Node, and represents an expanded entity, ie. the entity itself (eg. &), not the entity reference (eg. amp); entity references are controlled by the EntityReference interface.
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.
Entity nodes and their descendents are read-only, and can only be modified at the EntityReference level.
An Entity node can have Element, ProcessingInstruction, Comment, Text, CDATASection and EntityReference nodes as children.
- Annotations
- @RawJSType() @native()
- See also
http://reference.sitepoint.com/javascript/Entity
- trait EntityReference extends Object with Node
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.
- Annotations
- @RawJSType() @native()
- trait Event extends Object
The Event interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth).
The Event interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use are other interfaces based on the main Event interface. Event itself contains the properties and methods which are common to all events.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Event
- class EventSource extends Object with EventTarget
The EventSource interface is used to receive server-sent events.
The EventSource interface is used to receive server-sent events. It connects to a server over HTTP and receives events in text/event-stream format without closing the connection.
- Annotations
- @RawJSType() @native() @JSName( "EventSource" )
- See also
https://developer.mozilla.org/en-US/docs/Web/API/EventSource
- trait EventTarget extends Object
EventTarget is an interface implemented by objects that can receive events and may have listeners for them.
EventTarget is an interface implemented by objects that can receive events and may have listeners for them.
Element, document, and window are the most common event targets, but other objects can be event targets too, for example XMLHttpRequest, AudioNode, AudioContext, and others.
Many event targets (including elements, documents, and windows) also support setting event handlers via on... properties and attributes.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
- class EventTargetOptions extends Object
An options object that specifies characteristics about the event listener.
An options object that specifies characteristics about the event listener. The available options are:
- Annotations
- @RawJSType() @ScalaJSDefined()
- trait Node extends Object
The Node interface is the primary data type for the Document Object Model (DOM).
- trait Notation extends Object with Node
The Notation interface inherits from Node, and represents a notation declared in the DTD.
The Notation interface inherits from Node, and represents a notation declared in the DTD. Notations are typically used to declare the format of an unparsed entity; they can also be used for formal declaration of processing instruction targets. The content of an unparsed entity does not have to be text, it can be other kinds of data, such as an image.
Notation nodes are read-only, and are not part of the DOM tree, hence they have no parent and cannot have children.
- Annotations
- @RawJSType() @native()
- trait ParentNode extends Object with Node
The ParentNode interface contains methods that are particular to Node objects that can have children.
The ParentNode interface contains methods that are particular to Node objects that can have children.
ParentNode is a raw interface and no object of this type can be created; it is implemented by Element, Document, and DocumentFragment objects.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode
- class Performance extends Object
The Performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond.
The Performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Performance
- class ProcessingInstruction extends Object
Processing Instruction
Processing Instruction
- Annotations
- @RawJSType() @native()
- class Range extends Object
The Range interface represents a fragment of a document that can contain nodes and parts of text nodes.
The Range interface represents a fragment of a document that can contain nodes and parts of text nodes.
A range can be created using the createRange() method of the Document object. Range objects can also be retrieved by using the getRangeAt() method of the Selection object or the caretRangeAtPoint() method of the Document object.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Range
- type RangeType = Any
- class Text extends Object with CharacterData
The Text interface inherits from CharacterData, and represents the text content (referred to as character data) inside an Element or Attr node.
The Text interface inherits from CharacterData, and represents the text content (referred to as character data) inside an Element or Attr node.
When a document is first loaded there will be only one Text node for each block of text. Operations such as splitText may divide blocks of text into multiple sibling Text nodes, as may creating and adding new Text nodes, but such divisions will not persist between sessions. The normalize method merges adjacent nodes to [re]create the load state of a single Text node for each block of text.
A Text node cannot have children.
- Annotations
- @RawJSType() @native()
- type USVString = String
- type UnsignedLong = Long
- class XMLDocument extends Object with Document
The XMLDocument interface represent an XML document.
The XMLDocument interface represent an XML document. It inherits from the generic Document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/XMLDocument
Value Members
-
object
NodeTypes
Node Type Constants +---------------------------+----+ | Element | 1 | | Attr | 2 | | Text | 3 | | CDATASection | 4 | | EntityReference | 5 | | Entity | 6 | | ProcessingInstruction | 7 | | Comment | 8 | | Document | 9 | | DocumentType | 10 | | DocumentFragment | 11 | | Notation | 12 | +---------------------------+----+
-
object
Range
extends Object
Range Companion
Range Companion
- Annotations
- @native() @JSName( "Range" )
Inherited from AnyRef
Inherited from Any
Ungrouped