package js.html
extends Node › EventTarget
extended by HTMLDocument, XMLDocument
Available on js
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 also:
new()
Throws:
null |
DOMError |
---|
read onlyURL:String
Returns the document location as a string.
read onlyactiveElement:Element
read onlyanchors:HTMLCollection
Returns a list of all of the anchors in the document.
read onlyapplets:HTMLCollection
Returns an ordered list of the applets within a document.
body:Element
Returns the body
or frameset
node of the current document.
read onlycharacterSet:String
Returns the character set being used by the document.
read onlycharset:String
Alias of Document.characterSet
. Use this property instead.
read onlychildElementCount:Int
read onlychildren:HTMLCollection
read onlycompatMode:String
Indicates whether the document is rendered in quirks or strict mode.
read onlycontentType:String
Returns the Content-Type from the MIME Header of the current document.
read onlycurrentScript:Element
read onlydefaultView:Window
Returns a reference to the window object.
dir:String
Gets/sets directionality (rtl/ltr) of the document.
read onlydoctype:DocumentType
Returns the Document Type Definition (DTD) of the current document.
read onlydocumentElement:Element
Returns the Element
that is a direct child of the document. For HTML documents, this is normally the HTMLElement
element.
read onlydocumentURI:String
Returns the document location as a string.
read onlyembeds:HTMLCollection
Returns a list of the embedded embed
elements within the current document.
read onlyfirstElementChild:Element
read onlyfonts:FontFaceSet
read onlyforms:HTMLCollection
Returns a list of the form
elements within the current document.
read onlyfullscreen:Bool
true
when the document is in Using_full-screen_mode
.
read onlyfullscreenElement:Element
The element that's currently in full screen mode for this document.
read onlyfullscreenEnabled:Bool
read onlyhead:HeadElement
Returns the head
element of the current document.
read onlyhidden:Bool
…
read onlyimages:HTMLCollection
Returns a list of the images in the current document.
read onlyimplementation:DOMImplementation
Returns the DOM implementation associated with the current document.
read onlyinputEncoding:String
Alias of Document.characterSet
. Use this property instead.
read onlylastElementChild:Element
read onlylastModified:String
Returns the date on which the document was last modified.
read onlylastStyleSheetSet: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
.
read onlylinks:HTMLCollection
Returns a list of all the hyperlinks in the document.
read onlylocation:Location
Returns the URI of the current document.
onabort:Function
onafterscriptexecute:Function
Represents the event handling code for the afterscriptexecute
event.
onanimationcancel:Function
onanimationend:Function
onanimationiteration:Function
onanimationstart:Function
onauxclick:Function
onbeforescriptexecute:Function
Represents the event handling code for the beforescriptexecute
event.
onblur:Function
oncanplay:Function
oncanplaythrough:Function
onchange:Function
onclick:Function
onclose:Function
oncontextmenu:Function
oncopy:Function
Represents the event handling code for the copy
event.
oncut:Function
Represents the event handling code for the cut
event.
ondblclick:Function
ondrag:Function
ondragend:Function
ondragenter:Function
ondragexit:Function
ondragleave:Function
ondragover:Function
ondragstart:Function
ondrop:Function
ondurationchange:Function
onemptied:Function
onended:Function
onerror:Function
onfocus:Function
onfullscreenchange:Function
Is an EventHandler
representing the code to be called when the fullscreenchange
event is raised.
onfullscreenerror:Function
Is an EventHandler
representing the code to be called when the fullscreenerror
event is raised.
ongotpointercapture:Function
oninput:Function
oninvalid:Function
onkeydown:Function
onkeypress:Function
onkeyup:Function
onload:Function
onloadeddata:Function
onloadedmetadata:Function
onloadend:Function
onloadstart:Function
onlostpointercapture:Function
onmousedown:Function
onmouseenter:Function
onmouseleave:Function
onmousemove:Function
onmouseout:Function
onmouseover:Function
onmouseup:Function
onpaste:Function
Represents the event handling code for the paste
event.
onpause:Function
onplay:Function
onplaying:Function
onpointercancel:Function
onpointerdown:Function
onpointerenter:Function
onpointerleave:Function
onpointerlockchange:Function
Represents the event handling code for the pointerlockchange
event.
onpointerlockerror:Function
Represents the event handling code for the pointerlockerror
event.
onpointermove:Function
onpointerout:Function
onpointerover:Function
onpointerup:Function
onprogress:Function
onratechange:Function
onreadystatechange:Function
Represents the event handling code for the readystatechange
event.
onreset:Function
onresize:Function
onscroll:Function
onseeked:Function
onseeking:Function
onselect:Function
onselectionchange:Function
Is an EventHandler
representing the code to be called when the selectionchange
event is raised.
onselectstart:Function
onshow:Function
onstalled:Function
onsubmit:Function
onsuspend:Function
ontimeupdate:Function
ontoggle:Function
ontouchcancel:Function
ontouchend:Function
ontouchmove:Function
ontouchstart:Function
ontransitioncancel:Function
ontransitionend:Function
ontransitionrun:Function
ontransitionstart:Function
onvisibilitychange:Function
Is an EventHandler
representing the code to be called when the visibilitychange
event is raised.
onvolumechange:Function
onwaiting:Function
onwebkitanimationend:Function
onwebkitanimationiteration:Function
onwebkitanimationstart:Function
onwebkittransitionend:Function
onwheel:Function
Represents the event handling code for the wheel
event.
read onlyplugins:HTMLCollection
Returns a list of the available plugins.
read onlypointerLockElement:Element
read onlypreferredStyleSheetSet:String
Returns the preferred style sheet set as specified by the page author.
read onlyreadyState:String
Returns loading status of the document.
read onlyreferrer:String
Returns the URI of the page that linked to this page.
read onlyrootElement:SVGElement
read onlyscripts:HTMLCollection
Returns all the script
elements on the document.
read onlyscrollingElement:Element
Returns a reference to the Element
that scrolls the document.
selectedStyleSheetSet:String
Returns which style sheet set is currently in use.
read onlystyleSheetSets:DOMStringList
Returns a list of the style sheet sets available on the document.
read onlystyleSheets:StyleSheetList
read onlytimeline:DocumentTimeline
…
title:String
Sets or gets the title of the current document.
read onlyvisibilityState:VisibilityState
Returns a string
denoting the visibility state of the document. Possible values are visible
, hidden
, prerender
, and unloaded
.
adoptNode(node:Node):Node
Adopt node from an external document.
Throws:
null |
DOMError |
---|
append(nodes:Rest<Node>):Void
append(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
caretPositionFromPoint(x:Float, y:Float):CaretPosition
convertPointFromNode(point:DOMPointInit, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMPoint
Throws:
null |
DOMError |
---|
convertQuadFromNode(quad:DOMQuad, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null |
DOMError |
---|
convertRectFromNode(rect:DOMRectReadOnly, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null |
DOMError |
---|
createAttribute(name:String):Attr
Creates a new Attr
object and returns it.
Throws:
null |
DOMError |
---|
createAttributeNS(namespace:String, name:String):Attr
Creates a new attribute node in a given namespace and returns it.
Throws:
null |
DOMError |
---|
createCDATASection(data:String):CDATASection
Creates a new CDATA node and returns it.
Throws:
null |
DOMError |
---|
createComment(data:String):Comment
Creates a new comment node and returns it.
createDocumentFragment():DocumentFragment
Creates a new document fragment.
createElement(localName:String, ?options:Null<ElementCreationOptions>):Element
createElement(localName:String, ?options:String):Element
Creates a new element with the given tag name.
Throws:
null |
DOMError |
---|
createElementNS(namespace:String, qualifiedName:String, ?options:Null<ElementCreationOptions>):Element
createElementNS(namespace:String, qualifiedName:String, ?options:String):Element
Creates a new element with the given tag name and namespace URI.
Throws:
null |
DOMError |
---|
createEvent(interface_:String):Event
Creates an event object.
Throws:
null |
DOMError |
---|
createExpression(expression:String, ?resolver:String ‑> Null<String>):XPathExpression
createExpression(expression:String, ?resolver:Function):XPathExpression
createExpression(expression:String, ?resolver:Null<XPathNSResolver>):XPathExpression
Throws:
null |
DOMError |
---|
createNSResolver(nodeResolver:Node):Node
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):NodeIterator
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):NodeIterator
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):NodeIterator
Creates a NodeIterator
object.
Throws:
null |
DOMError |
---|
createProcessingInstruction(target:String, data:String):ProcessingInstruction
Creates a new ProcessingInstruction
object.
Throws:
null |
DOMError |
---|
createRange():Range
Creates a Range
object.
Throws:
null |
DOMError |
---|
createTextNode(data:String):Text
Creates a text node.
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.
createTouchList(touches:Array<Touch>):TouchList
createTouchList(touch:Touch, touches:Rest<Touch>):TouchList
createTouchList():TouchList
Creates a TouchList
object.
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):TreeWalker
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):TreeWalker
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):TreeWalker
Creates a TreeWalker
object.
Throws:
null |
DOMError |
---|
elementFromPoint(x:Float, y:Float):Element
elementsFromPoint(x:Float, y:Float):Array<Element>
enableStyleSheetsForSet(name:String):Void
Enables the style sheets for the specified style sheet set.
evaluate(expression:String, contextNode:Node, ?resolver:String ‑> Null<String>, type:Int = 0, ?result:Dynamic):XPathResult
evaluate(expression:String, contextNode:Node, ?resolver:Function, type:Int = 0, ?result:Dynamic):XPathResult
evaluate(expression:String, contextNode:Node, ?resolver:Null<XPathNSResolver>, type:Int = 0, ?result:Dynamic):XPathResult
Throws:
null |
DOMError |
---|
exitFullscreen():Void
exitPointerLock():Void
Release the pointer lock.
getAnimations():Array<Animation>
Returns an array of all Animation
objects currently in effect, whose target elements are descendants of the document
.
getElementById(elementId:String):Element
getElementsByClassName(classNames:String):HTMLCollection
Returns a list of elements with the given class name.
getElementsByName(elementName:String):NodeList
getElementsByTagName(localName:String):HTMLCollection
Returns a list of elements with the given tag name.
getElementsByTagNameNS(namespace:String, localName:String):HTMLCollection
Returns a list of elements with the given tag name and namespace.
Throws:
null |
DOMError |
---|
getSelection():Selection
Throws:
null |
DOMError |
---|
hasFocus():Bool
Returns true
if the focus is currently located anywhere inside the specified document.
Throws:
null |
DOMError |
---|
importNode(node:Node, deep:Bool = false):Node
Returns a clone of a node from an external document.
Throws:
null |
DOMError |
---|
prepend(nodes:Rest<Node>):Void
prepend(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
querySelector(selectors:String):Element
Throws:
null |
DOMError |
---|
querySelectorAll(selectors:String):NodeList
Throws:
null |
DOMError |
---|
releaseCapture():Void
Releases the current mouse capture if it's on an element in this document.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Document.html