Haxe API Documentation
Back | Index
extern class js.html.Element
extends Node
Available in js

This chapter provides a brief reference for the general methods, properties, and events available to most HTML and XML elements in the Gecko DOM.

Various W3C specifications apply to elements:

The articles listed here span the above and include links to the appropriate W3C DOM specification.

While these interfaces are generally shared by most HTML and XML elements, there are more specialized interfaces for particular objects listed in the DOM HTML Specification. Note, however, that these HTML interfaces are "only for HTML 4.01 and XHTML 1.0 documents and are not guaranteed to work with any future version of XHTML." The HTML 5 draft does state it aims for backwards compatibility with these HTML interfaces but says of them that "some features that were formerly deprecated, poorly supported, rarely used or considered unnecessary have been removed." One can avoid the potential conflict by moving entirely to DOM XML attribute methods such as getAttribute().

Html , Head , Link , Title , Meta , Base , IsIndex , Style , Body , Form , Select , OptGroup , Option, Input , TextArea , Button , Label , FieldSet , Legend , UList , OList , DList , Directory , Menu , LI , Div , Paragraph , Heading , Quote , Pre , BR , BaseFont , Font , HR , Mod , Anchor , Image , Object , Param , Applet , Map , Area , Script , Table , TableCaption , TableCol , TableSection , TableRow , TableCell , FrameSet , Frame , IFrame



Documentation for this class was provided by MDN.
var accessKey : String
var childElementCount(default,null) : Int
The number of child nodes that are elements.
var children(default,null) : HTMLCollection
A live nsIDOMNodeList of the current child elements.
var classList(default,null) : DOMTokenList
Token list of class attribute
var className : String
Gets/sets the class of the element.
var clientHeight(default,null) : Int
The inner height of an element.
var clientLeft(default,null) : Int
The width of the left border of an element.
var clientTop(default,null) : Int
The width of the top border of an element.
var clientWidth(default,null) : Int
The inner width of an element.
var contentEditable : String
Gets/sets whether or not the element is editable. Setter throws DOMException.
var dataset(default,null) : DOMStringMap
Allows access to read and write custom data attributes on the element.
var dir : String
Gets/sets the directionality of the element.
var draggable : Bool
var dropzone : String
var firstElementChild(default,null) : Element
The first direct child element of an element, or null if the element has no child elements.
var hidden : Bool
var id : String
Gets/sets the id of the element.
var innerHTML : String
Gets/sets the markup of the element's content. Setter throws DOMException.
var innerText : String
Setter throws DOMException.
var isContentEditable(default,null) : Bool
Indicates whether or not the content of the element can be edited. Read only.
var lang : String
Gets/sets the language of an element's attributes, text, and element contents.
var lastElementChild(default,null) : Element
The last direct child element of an element, or null if the element has no child elements.
var nextElementSibling(default,null) : Element
The element immediately following the given one in the tree, or null if there's no sibling node.
var offsetHeight(default,null) : Int
The height of an element, relative to the layout.
var offsetLeft(default,null) : Int
The distance from this element's left border to its offsetParent's left border.
var offsetParent(default,null) : Element
The element from which all offset calculations are currently computed.
var offsetTop(default,null) : Int
The distance from this element's top border to its offsetParent's top border.
var offsetWidth(default,null) : Int
The width of an element, relative to the layout.
var onabort : EventListener
var onbeforecopy : EventListener
var onbeforecut : EventListener
var onbeforepaste : EventListener
var onblur : EventListener
Returns the event handling code for the blur event.
var onchange : EventListener
Returns the event handling code for the change event.
var onclick : EventListener
Returns the event handling code for the click event.
var oncontextmenu : EventListener
Returns the event handling code for the contextmenu event.
var oncopy : EventListener
Returns the event handling code for the copy event.
var oncut : EventListener
Returns the event handling code for the cut event.
var ondblclick : EventListener
Returns the event handling code for the dblclick event.
var ondrag : EventListener
var ondragend : EventListener
var ondragenter : EventListener
var ondragleave : EventListener
var ondragover : EventListener
var ondragstart : EventListener
var ondrop : EventListener
var onerror : EventListener
var onfocus : EventListener
Returns the event handling code for the focus event.
var onfullscreenchange : EventListener
var onfullscreenerror : EventListener
var oninput : EventListener
var oninvalid : EventListener
var onkeydown : EventListener
Returns the event handling code for the keydown event.
var onkeypress : EventListener
Returns the event handling code for the keypress event.
var onkeyup : EventListener
Returns the event handling code for the keyup event.
var onload : EventListener
var onmousedown : EventListener
Returns the event handling code for the mousedown event.
var onmousemove : EventListener
Returns the event handling code for the mousemove event.
var onmouseout : EventListener
Returns the event handling code for the mouseout event.
var onmouseover : EventListener
Returns the event handling code for the mouseover event.
var onmouseup : EventListener
Returns the event handling code for the mouseup event.
var onmousewheel : EventListener
var onpaste : EventListener
Returns the event handling code for the paste event.
var onreset : EventListener
var onscroll : EventListener
Returns the event handling code for the scroll event.
var onsearch : EventListener
var onselect : EventListener
var onselectstart : EventListener
var onsubmit : EventListener
var ontouchcancel : EventListener
var ontouchend : EventListener
var ontouchmove : EventListener
var ontouchstart : EventListener
var outerHTML : String
Gets the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string. Setter throws DOMException.
var outerText : String
Setter throws DOMException.
var previousElementSibling(default,null) : Element
The element immediately preceding the given one in the tree, or null if there is no sibling element.
var pseudo : String
var scrollHeight(default,null) : Int
The scroll view height of an element.
var scrollLeft : Int
Gets/sets the left scroll offset of an element.
var scrollTop : Int
Gets/sets the top scroll offset of an element.
var scrollWidth(default,null) : Int
The scroll view width of an element.
var spellcheck : Bool
Controls spell-checking (present on all HTML elements)
var style(default,null) : CSSStyleDeclaration
An object representing the declarations of an element's style attributes.
var tabIndex : Int
Gets/sets the position of the element in the tabbing order.
var tagName(default,null) : String
The name of the tag for the given element.
var title : String
A string that appears in a popup box when mouse is over the element.
var translate : Bool
function blur() : Void
function click() : Void
function focus() : Void
function getAttribute(name : String) : String
function getAttributeNS(?namespaceURI : String, localName : String) : String
function getAttributeNode(name : String) : Attr
function getAttributeNodeNS(?namespaceURI : String, localName : String) : Attr
function getBoundingClientRect() : ClientRect
function getClientRects() : ClientRectList
function getElementsByClassName(name : String) : NodeList
function getElementsByTagName(name : String) : NodeList
function getElementsByTagNameNS(?namespaceURI : String, localName : String) : NodeList
function hasAttribute(name : String) : Bool
function hasAttributeNS(?namespaceURI : String, localName : String) : Bool
function insertAdjacentElement(where : String, element : Element) : Element
function insertAdjacentHTML(where : String, html : String) : Void
function insertAdjacentText(where : String, text : String) : Void
function matchesSelector(selectors : String) : Bool
function querySelector(selectors : String) : Element
function querySelectorAll(selectors : String) : NodeList
function remove() : Void
function removeAttribute(name : String) : Void
function removeAttributeNS(namespaceURI : String, localName : String) : Void
function removeAttributeNode(oldAttr : Attr) : Attr
function requestFullScreen(flags : Int) : Void
function requestFullscreen() : Void
function requestPointerLock() : Void
function scrollByLines(lines : Int) : Void
function scrollByPages(pages : Int) : Void
function scrollIntoView(?alignWithTop : Bool) : Void
function scrollIntoViewIfNeeded(?centerIfNeeded : Bool) : Void
function setAttribute(name : String, value : String) : Void
function setAttributeNS(?namespaceURI : String, qualifiedName : String, value : String) : Void
function setAttributeNode(newAttr : Attr) : Attr
function setAttributeNodeNS(newAttr : Attr) : Attr
static inline var ALLOW_KEYBOARD_INPUT : Int
Back | Index