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:StringReturns the document location as a string.
read onlyactiveElement:Elementread onlyanchors:HTMLCollectionReturns a list of all of the anchors in the document.
read onlyapplets:HTMLCollectionReturns an ordered list of the applets within a document.
body:ElementReturns the body or frameset node of the current document.
read onlycharacterSet:StringReturns the character set being used by the document.
read onlycharset:StringAlias of Document.characterSet. Use this property instead.
read onlychildElementCount:Intread onlychildren:HTMLCollectionread onlycompatMode:StringIndicates whether the document is rendered in quirks or strict mode.
read onlycontentType:StringReturns the Content-Type from the MIME Header of the current document.
read onlycurrentScript:Elementread onlydefaultView:WindowReturns a reference to the window object.
dir:StringGets/sets directionality (rtl/ltr) of the document.
read onlydoctype:DocumentTypeReturns the Document Type Definition (DTD) of the current document.
read onlydocumentElement:ElementReturns the Element that is a direct child of the document. For HTML documents, this is normally the HTMLElement element.
read onlydocumentURI:StringReturns the document location as a string.
read onlyembeds:HTMLCollectionReturns a list of the embedded embed elements within the current document.
read onlyfirstElementChild:Elementread onlyfonts:FontFaceSetread onlyforms:HTMLCollectionReturns a list of the form elements within the current document.
read onlyfullscreen:Booltrue when the document is in Using_full-screen_mode.
read onlyfullscreenElement:ElementThe element that's currently in full screen mode for this document.
read onlyfullscreenEnabled:Boolread onlyhead:HeadElementReturns the head element of the current document.
read onlyhidden:Bool…
read onlyimages:HTMLCollectionReturns a list of the images in the current document.
read onlyimplementation:DOMImplementationReturns the DOM implementation associated with the current document.
read onlyinputEncoding:StringAlias of Document.characterSet. Use this property instead.
read onlylastElementChild:Elementread onlylastModified:StringReturns the date on which the document was last modified.
read onlylastStyleSheetSet:StringReturns 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:HTMLCollectionReturns a list of all the hyperlinks in the document.
read onlylocation:LocationReturns the URI of the current document.
onabort:Functiononafterscriptexecute:FunctionRepresents the event handling code for the afterscriptexecute event.
onanimationcancel:Functiononanimationend:Functiononanimationiteration:Functiononanimationstart:Functiononauxclick:Functiononbeforescriptexecute:FunctionRepresents the event handling code for the beforescriptexecute event.
onblur:Functiononcanplay:Functiononcanplaythrough:Functiononchange:Functiononclick:Functiononclose:Functiononcontextmenu:Functiononcopy:FunctionRepresents the event handling code for the copy event.
oncut:FunctionRepresents the event handling code for the cut event.
ondblclick:Functionondrag:Functionondragend:Functionondragenter:Functionondragexit:Functionondragleave:Functionondragover:Functionondragstart:Functionondrop:Functionondurationchange:Functiononemptied:Functiononended:Functiononerror:Functiononfocus:Functiononfullscreenchange:FunctionIs an EventHandler representing the code to be called when the fullscreenchange event is raised.
onfullscreenerror:FunctionIs an EventHandler representing the code to be called when the fullscreenerror event is raised.
ongotpointercapture:Functiononinput:Functiononinvalid:Functiononkeydown:Functiononkeypress:Functiononkeyup:Functiononload:Functiononloadeddata:Functiononloadedmetadata:Functiononloadend:Functiononloadstart:Functiononlostpointercapture:Functiononmousedown:Functiononmouseenter:Functiononmouseleave:Functiononmousemove:Functiononmouseout:Functiononmouseover:Functiononmouseup:Functiononpaste:FunctionRepresents the event handling code for the paste event.
onpause:Functiononplay:Functiononplaying:Functiononpointercancel:Functiononpointerdown:Functiononpointerenter:Functiononpointerleave:Functiononpointerlockchange:FunctionRepresents the event handling code for the pointerlockchange event.
onpointerlockerror:FunctionRepresents the event handling code for the pointerlockerror event.
onpointermove:Functiononpointerout:Functiononpointerover:Functiononpointerup:Functiononprogress:Functiononratechange:Functiononreadystatechange:FunctionRepresents the event handling code for the readystatechange event.
onreset:Functiononresize:Functiononscroll:Functiononseeked:Functiononseeking:Functiononselect:Functiononselectionchange:FunctionIs an EventHandler representing the code to be called when the selectionchange event is raised.
onselectstart:Functiononshow:Functiononstalled:Functiononsubmit:Functiononsuspend:Functionontimeupdate:Functionontoggle:Functionontouchcancel:Functionontouchend:Functionontouchmove:Functionontouchstart:Functionontransitioncancel:Functionontransitionend:Functionontransitionrun:Functionontransitionstart:Functiononvisibilitychange:FunctionIs an EventHandler representing the code to be called when the visibilitychange event is raised.
onvolumechange:Functiononwaiting:Functiononwebkitanimationend:Functiononwebkitanimationiteration:Functiononwebkitanimationstart:Functiononwebkittransitionend:Functiononwheel:FunctionRepresents the event handling code for the wheel event.
read onlyplugins:HTMLCollectionReturns a list of the available plugins.
read onlypointerLockElement:Elementread onlypreferredStyleSheetSet:StringReturns the preferred style sheet set as specified by the page author.
read onlyreadyState:StringReturns loading status of the document.
read onlyreferrer:StringReturns the URI of the page that linked to this page.
read onlyrootElement:SVGElementread onlyscripts:HTMLCollectionReturns all the script elements on the document.
read onlyscrollingElement:ElementReturns a reference to the Element that scrolls the document.
selectedStyleSheetSet:StringReturns which style sheet set is currently in use.
read onlystyleSheetSets:DOMStringListReturns a list of the style sheet sets available on the document.
read onlystyleSheets:StyleSheetListread onlytimeline:DocumentTimeline…
title:StringSets or gets the title of the current document.
read onlyvisibilityState:VisibilityStateReturns a string denoting the visibility state of the document. Possible values are visible, hidden, prerender, and unloaded.
adoptNode(node:Node):NodeAdopt node from an external document.
Throws:
null |
DOMError |
|---|
append(nodes:Rest<Node>):Voidappend(nodes:Rest<String>):VoidThrows:
null |
DOMError |
|---|
caretPositionFromPoint(x:Float, y:Float):CaretPositionconvertPointFromNode(point:DOMPointInit, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMPointconvertPointFromNode(point:DOMPointInit, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMPointconvertPointFromNode(point:DOMPointInit, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMPointThrows:
null |
DOMError |
|---|
convertQuadFromNode(quad:DOMQuad, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuadconvertQuadFromNode(quad:DOMQuad, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuadconvertQuadFromNode(quad:DOMQuad, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuadThrows:
null |
DOMError |
|---|
convertRectFromNode(rect:DOMRectReadOnly, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuadconvertRectFromNode(rect:DOMRectReadOnly, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuadconvertRectFromNode(rect:DOMRectReadOnly, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuadThrows:
null |
DOMError |
|---|
createAttribute(name:String):AttrCreates a new Attr object and returns it.
Throws:
null |
DOMError |
|---|
createAttributeNS(namespace:String, name:String):AttrCreates a new attribute node in a given namespace and returns it.
Throws:
null |
DOMError |
|---|
createCDATASection(data:String):CDATASectionCreates a new CDATA node and returns it.
Throws:
null |
DOMError |
|---|
createComment(data:String):CommentCreates a new comment node and returns it.
createDocumentFragment():DocumentFragmentCreates a new document fragment.
createElement(localName:String, ?options:Null<ElementCreationOptions>):ElementcreateElement(localName:String, ?options:String):ElementCreates a new element with the given tag name.
Throws:
null |
DOMError |
|---|
createElementNS(namespace:String, qualifiedName:String, ?options:Null<ElementCreationOptions>):ElementcreateElementNS(namespace:String, qualifiedName:String, ?options:String):ElementCreates a new element with the given tag name and namespace URI.
Throws:
null |
DOMError |
|---|
createEvent(interface_:String):EventCreates an event object.
Throws:
null |
DOMError |
|---|
createExpression(expression:String, ?resolver:String ‑> Null<String>):XPathExpressioncreateExpression(expression:String, ?resolver:Function):XPathExpressioncreateExpression(expression:String, ?resolver:Null<XPathNSResolver>):XPathExpressionThrows:
null |
DOMError |
|---|
createNSResolver(nodeResolver:Node):NodecreateNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):NodeIteratorcreateNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):NodeIteratorcreateNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):NodeIteratorCreates a NodeIterator object.
Throws:
null |
DOMError |
|---|
createProcessingInstruction(target:String, data:String):ProcessingInstructionCreates a new ProcessingInstruction object.
Throws:
null |
DOMError |
|---|
createRange():RangeCreates a Range object.
Throws:
null |
DOMError |
|---|
createTextNode(data:String):TextCreates 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):TouchCreates a Touch object.
createTouchList(touches:Array<Touch>):TouchListcreateTouchList(touch:Touch, touches:Rest<Touch>):TouchListcreateTouchList():TouchListCreates a TouchList object.
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):TreeWalkercreateTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):TreeWalkercreateTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):TreeWalkerCreates a TreeWalker object.
Throws:
null |
DOMError |
|---|
elementFromPoint(x:Float, y:Float):ElementelementsFromPoint(x:Float, y:Float):Array<Element>enableStyleSheetsForSet(name:String):VoidEnables the style sheets for the specified style sheet set.
evaluate(expression:String, contextNode:Node, ?resolver:String ‑> Null<String>, type:Int = 0, ?result:Dynamic):XPathResultevaluate(expression:String, contextNode:Node, ?resolver:Function, type:Int = 0, ?result:Dynamic):XPathResultevaluate(expression:String, contextNode:Node, ?resolver:Null<XPathNSResolver>, type:Int = 0, ?result:Dynamic):XPathResultThrows:
null |
DOMError |
|---|
exitFullscreen():VoidexitPointerLock():VoidRelease 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):ElementgetElementsByClassName(classNames:String):HTMLCollectionReturns a list of elements with the given class name.
getElementsByName(elementName:String):NodeListgetElementsByTagName(localName:String):HTMLCollectionReturns a list of elements with the given tag name.
getElementsByTagNameNS(namespace:String, localName:String):HTMLCollectionReturns a list of elements with the given tag name and namespace.
Throws:
null |
DOMError |
|---|
getSelection():SelectionThrows:
null |
DOMError |
|---|
hasFocus():BoolReturns true if the focus is currently located anywhere inside the specified document.
Throws:
null |
DOMError |
|---|
importNode(node:Node, deep:Bool = false):NodeReturns a clone of a node from an external document.
Throws:
null |
DOMError |
|---|
prepend(nodes:Rest<Node>):Voidprepend(nodes:Rest<String>):VoidThrows:
null |
DOMError |
|---|
querySelector(selectors:String):ElementThrows:
null |
DOMError |
|---|
querySelectorAll(selectors:String):NodeListThrows:
null |
DOMError |
|---|
releaseCapture():VoidReleases 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