Document

EventTargetNodejs.html.Document (extern class) → HTMLDocument

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.HTMLElement

Documentation Document by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

implementation: DOMImplementation

Returns the DOM implementation associated with the current document.


URL: String

Returns the document location as a string.


documentURI: String

Returns the document location as a string.


compatMode: String

Indicates whether the document is rendered in quirks or strict mode.


characterSet: String

Returns the character set being used by the document.


charset: String

Alias of Document.characterSet. Use this property instead.


inputEncoding: String

Alias of Document.characterSet. Use this property instead.


contentType: String

Returns the Content-Type from the MIME Header of the current document.


doctype: DocumentType

Returns the Document Type Definition (DTD) of the current document.


documentElement: Element

Returns the Element that is a direct child of the document. For HTML documents, this is normally the HTMLElement element.


location: Location

Returns the URI of the current document.


referrer: String

Returns the URI of the page that linked to this page.


lastModified: String

Returns the date on which the document was last modified.


readyState: String

Returns loading status of the document.


title: String

Sets or gets the title of the current document.


dir: String

Gets/sets directionality (rtl/ltr) of the document.


body: Element

Returns the body or frameset node of the current document.


Returns the head element of the current document.


Returns a list of the images in the current document.


Returns a list of the embedded embed elements within the current document.


Returns a list of the available plugins.


Returns a list of all the hyperlinks in the document.


Returns a list of the form elements within the current document.


Returns all the script elements on the document.


defaultView: Window

Returns a reference to the window object.


onreadystatechange: haxe.Function

Represents the event handling code for the readystatechange event.


onbeforescriptexecute: haxe.Function

Represents the event handling code for the beforescriptexecute event.


onafterscriptexecute: haxe.Function

Represents the event handling code for the afterscriptexecute event.


onselectionchange: haxe.Function

Is an EventHandler representing the code to be called when the selectionchange event is raised.


currentScript: Element

Returns a list of all of the anchors in the document.


Returns an ordered list of the applets within a document.


fullscreen: Bool

true when the document is in Using_full-screen_mode.


fullscreenEnabled: Bool

onfullscreenchange: haxe.Function

Is an EventHandler representing the code to be called when the fullscreenchange event is raised.


onfullscreenerror: haxe.Function

Is an EventHandler representing the code to be called when the fullscreenerror event is raised.


onpointerlockchange: haxe.Function

Represents the event handling code for the pointerlockchange event.


onpointerlockerror: haxe.Function

Represents the event handling code for the pointerlockerror event.


hidden: Bool


visibilityState: VisibilityState

Returns a string denoting the visibility state of the document. Possible values are visiblehiddenprerender, and unloaded.


onvisibilitychange: haxe.Function

Is an EventHandler representing the code to be called when the visibilitychange event is raised.


selectedStyleSheetSet: String

Returns which style sheet set is currently in use.


lastStyleSheetSet: String

Returns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of document.selectedStyleSheetSet.


preferredStyleSheetSet: String

Returns the preferred style sheet set as specified by the page author.


styleSheetSets: DOMStringList

Returns a list of the style sheet sets available on the document.


scrollingElement: Element

Returns a reference to the Element that scrolls the document.




Represents the event handling code for the copy event.


Represents the event handling code for the cut event.


Represents the event handling code for the paste event.


activeElement: Element

styleSheets: StyleSheetList

pointerLockElement: Element

fullscreenElement: Element

The element that's currently in full screen mode for this document.






onauxclick: haxe.Function

oncanplay: haxe.Function

oncanplaythrough: haxe.Function

onchange: haxe.Function



oncontextmenu: haxe.Function

ondblclick: haxe.Function


ondragend: haxe.Function

ondragenter: haxe.Function

ondragexit: haxe.Function

ondragleave: haxe.Function

ondragover: haxe.Function

ondragstart: haxe.Function


ondurationchange: haxe.Function

onemptied: haxe.Function



oninvalid: haxe.Function

onkeydown: haxe.Function

onkeypress: haxe.Function



onloadeddata: haxe.Function

onloadedmetadata: haxe.Function

onloadend: haxe.Function

onloadstart: haxe.Function

onmousedown: haxe.Function

onmouseenter: haxe.Function

onmouseleave: haxe.Function

onmousemove: haxe.Function

onmouseout: haxe.Function

onmouseover: haxe.Function

onmouseup: haxe.Function

Represents the event handling code for the wheel event.




onplaying: haxe.Function

onprogress: haxe.Function

onratechange: haxe.Function


onresize: haxe.Function

onscroll: haxe.Function

onseeked: haxe.Function

onseeking: haxe.Function

onselect: haxe.Function


onstalled: haxe.Function

onsubmit: haxe.Function

onsuspend: haxe.Function

ontimeupdate: haxe.Function

onvolumechange: haxe.Function

onwaiting: haxe.Function

onselectstart: haxe.Function

ontoggle: haxe.Function

onpointercancel: haxe.Function

onpointerdown: haxe.Function

onpointerup: haxe.Function

onpointermove: haxe.Function

onpointerout: haxe.Function

onpointerover: haxe.Function

onpointerenter: haxe.Function

onpointerleave: haxe.Function

ongotpointercapture: haxe.Function

onlostpointercapture: haxe.Function

onanimationcancel: haxe.Function

onanimationend: haxe.Function

onanimationiteration: haxe.Function

onanimationstart: haxe.Function

ontransitioncancel: haxe.Function

ontransitionend: haxe.Function

ontransitionrun: haxe.Function

ontransitionstart: haxe.Function

onwebkitanimationend: haxe.Function

onwebkitanimationiteration: haxe.Function

onwebkitanimationstart: haxe.Function

onwebkittransitionend: haxe.Function


children: HTMLCollection

firstElementChild: Element

lastElementChild: Element

childElementCount: Int

ontouchstart: haxe.Function

ontouchend: haxe.Function

ontouchmove: haxe.Function

ontouchcancel: haxe.Function

getElementsByTagName(localName: String): HTMLCollection

Returns a list of elements with the given tag name.

Name Type
localName String
Returns
HTMLCollection

getElementsByTagNameNS(namespace: String, localName: String): HTMLCollection

Returns a list of elements with the given tag name and namespace.

Name Type
namespace String
localName String
Returns
HTMLCollection

getElementsByClassName(classNames: String): HTMLCollection

Returns a list of elements with the given class name.

Name Type
classNames String
Returns
HTMLCollection

getElementById(elementId: String): Element
Name Type
elementId String
Returns
Element

createElement(localName: String, ?options: Null<ElementCreationOptions>): Element

Creates a new element with the given tag name.

Name Type Default
localName String
options Null<ElementCreationOptions> (optional)
Returns
Element

createElementNS(namespace: String, qualifiedName: String, ?options: Null<ElementCreationOptions>): Element

Creates a new element with the given tag name and namespace URI.

Name Type Default
namespace String
qualifiedName String
options Null<ElementCreationOptions> (optional)
Returns
Element

createDocumentFragment(): DocumentFragment

Creates a new document fragment.

Returns
DocumentFragment

createTextNode(data: String): Text

Creates a text node.

Name Type
data String
Returns
Text

createComment(data: String): Comment

Creates a new comment node and returns it.

Name Type
data String
Returns
Comment

createProcessingInstruction(target: String, data: String): ProcessingInstruction

Creates a new ProcessingInstruction object.

Name Type
target String
data String
Returns
ProcessingInstruction

importNode(node: Node, ?deep: Bool = false): Node

Returns a clone of a node from an external document.

Name Type Default
node Node
deep Bool false
Returns
Node

adoptNode(node: Node): Node

Adopt node from an external document.

Name Type
node Node
Returns
Node

createEvent(interface_: String): Event

Creates an event object.

Name Type
interface_ String
Returns
Event

createRange(): Range

Creates a Range object.

Returns
Range

createNodeIterator(root: Node, ?whatToShow: Int = cast 4294967295, ?filter: Function): NodeIterator

Creates a NodeIterator object.

Name Type Default
root Node
whatToShow Int cast 4294967295
filter Function (optional)
Returns
NodeIterator

createTreeWalker(root: Node, ?whatToShow: Int = cast 4294967295, ?filter: Function): TreeWalker

Creates a TreeWalker object.

Name Type Default
root Node
whatToShow Int cast 4294967295
filter Function (optional)
Returns
TreeWalker

createCDATASection(data: String): CDATASection

Creates a new CDATA node and returns it.

Name Type
data String
Returns
CDATASection

createAttribute(name: String): Attr

Creates a new Attr object and returns it.

Name Type
name String
Returns
Attr

createAttributeNS(namespace: String, name: String): Attr

Creates a new attribute node in a given namespace and returns it.

Name Type
namespace String
name String
Returns
Attr

getElementsByName(elementName: String): NodeList
Name Type
elementName String
Returns
NodeList

hasFocus(): Bool

Returns true if the focus is currently located anywhere inside the specified document.

Returns
Bool

releaseCapture(): Void

Releases the current mouse capture if it's on an element in this document.


exitFullscreen(): js.lib.Promise<Void>

Requests that the element on this document which is currently being presented in fullscreen mode be taken out of fullscreen mode, restoring the previous state of the screen.

Returns
js.lib.Promise<Void>

exitPointerLock(): Void

Release the pointer lock.


enableStyleSheetsForSet(name: String): Void

Enables the style sheets for the specified style sheet set.

Name Type
name String

caretPositionFromPoint(x: Float, y: Float): CaretPosition
Name Type
x Float
y Float
Returns
CaretPosition

querySelector(selectors: String): Element
Name Type
selectors String
Returns
Element

querySelectorAll(selectors: String): NodeList
Name Type
selectors String
Returns
NodeList

getAnimations(): Array<Animation>

Returns an array of all Animation objects currently in effect, whose target elements are descendants of the document.

Returns
Array<Animation>

createTouch(?view: Window, ?target: EventTarget, ?identifier: Int = 0, ?pageX: Int = 0, ?pageY: Int = 0, ?screenX: Int = 0, ?screenY: Int = 0, ?clientX: Int = 0, ?clientY: Int = 0, ?radiusX: Int = 0, ?radiusY: Int = 0, ?rotationAngle: Float = 0.0, ?force: Float = 0.0): Touch

Creates a Touch object.

Name Type Default
view Window (optional)
target EventTarget (optional)
identifier Int 0
pageX Int 0
pageY Int 0
screenX Int 0
screenY Int 0
clientX Int 0
clientY Int 0
radiusX Int 0
radiusY Int 0
rotationAngle Float 0.0
force Float 0.0
Returns
Touch

createTouchList(touches: Array<Touch>): TouchList

Creates a TouchList object.

Name Type
touches Array<Touch>
Returns
TouchList

getSelection(): Selection
Returns
Selection

elementFromPoint(x: Float, y: Float): Element
Name Type
x Float
y Float
Returns
Element

elementsFromPoint(x: Float, y: Float): Array<Element>
Name Type
x Float
y Float
Returns
Array<Element>

convertQuadFromNode(quad: DOMQuad, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad
Name Type Default
quad DOMQuad
from Text
options Null<ConvertCoordinateOptions> (optional)
Returns
DOMQuad

convertRectFromNode(rect: DOMRectReadOnly, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad
Name Type Default
rect DOMRectReadOnly
from Text
options Null<ConvertCoordinateOptions> (optional)
Returns
DOMQuad

convertPointFromNode(point: DOMPointInit, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMPoint
Name Type Default
point DOMPointInit
from Text
options Null<ConvertCoordinateOptions> (optional)
Returns
DOMPoint

prepend(nodes: haxe.extern.Rest): Void
Name Type
nodes haxe.extern.Rest

append(nodes: haxe.extern.Rest): Void
Name Type
nodes haxe.extern.Rest

createExpression(expression: String, ?resolver: Function): XPathExpression
Name Type Default
expression String
resolver Function (optional)
Returns
XPathExpression

createNSResolver(nodeResolver: Node): Node
Name Type
nodeResolver Node
Returns
Node

evaluate(expression: String, contextNode: Node, ?resolver: Function, ?type: Int = 0, ?result: Dynamic): XPathResult
Name Type Default
expression String
contextNode Node
resolver Function (optional)
type Int 0
result Dynamic (optional)
Returns
XPathResult

new(): Void