class js.html.Element extends Node
Available on jsThis 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:
- DOM Core Specification—describes the core interfaces shared by most DOM objects in HTML and XML documents
- DOM HTML Specification—describes interfaces for objects in HTML and XHTML documents that build on the core specification
- DOM Events Specification—describes events shared by most DOM objects, building on the DOM Core and Views specifications
- Element Traversal Specification—describes the new attributes that allow traversal of elements in the DOM tree New in Firefox 3.5
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.
Class Fields
Instance Fields
var contentEditable:String
Gets/sets whether or not the element is editable. Setter throws DOMException.
var firstElementChild:Element
The first direct child element of an element, or null if the element has no child elements.
var isContentEditable:Bool
Indicates whether or not the content of the element can be edited. Read only.
var lastElementChild:Element
The last direct child element of an element, or null if the element has no child elements.
var nextElementSibling:Element
The element immediately following the given one in the tree, or null if there's no sibling node.
var onabort:EventListener
var ondrag:EventListener
var ondrop:EventListener
var onerror:EventListener
var oninput:EventListener
var onload:EventListener
var onreset: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 previousElementSibling:Element
The element immediately preceding the given one in the tree, or null if there is no sibling element.
var style:CSSStyleDeclaration
An object representing the declarations of an element's style attributes.