|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

, HTMLAppletElement
, HTMLAreaElement
, HTMLBaseElement
, HTMLBaseFontElement
, HTMLBodyElement
, HTMLBRElement
, HTMLButtonElement
, HTMLDirectoryElement
, HTMLDivElement
, HTMLDListElement
, HTMLElement
, HTMLFieldSetElement
, HTMLFontElement
, HTMLFormElement
, HTMLFrameElement
, HTMLFrameSetElement
, HTMLHeadElement
, HTMLHeadingElement
, HTMLHRElement
, HTMLHtmlElement
, HTMLIFrameElement
, HTMLImageElement
, HTMLInputElement
, HTMLIsIndexElement
, HTMLLabelElement
, HTMLLegendElement
, HTMLLIElement
, HTMLLinkElement
, HTMLMapElement
, HTMLMenuElement
, HTMLMetaElement
, HTMLModElement
, HTMLObjectElement
, HTMLOListElement
, HTMLOptGroupElement
, HTMLOptionElement
, HTMLParagraphElement
, HTMLParamElement
, HTMLPreElement
, HTMLQuoteElement
, HTMLScriptElement
, HTMLSelectElement
, HTMLStyleElement
, HTMLTableCaptionElement
, HTMLTableCellElement
, HTMLTableColElement
, HTMLTableElement
, HTMLTableRowElement
, HTMLTableSectionElement
, HTMLTextAreaElement
, HTMLTitleElement
, HTMLUListElement


public interface Element

The Element interface represents an element in an HTML or XML
document. Elements may have attributes associated with them; since the
Element interface inherits from Node, the
generic Node interface attribute attributes may
be used to retrieve the set of all attributes for an element. There are
methods on the Element interface to retrieve either an
Attr object by name or an attribute value by name. In XML,
where an attribute value may contain entity references, an
Attr object should be retrieved to examine the possibly
fairly complex sub-tree representing the attribute value. On the other
hand, in HTML, where all attributes have simple string values, methods to
directly access an attribute value can safely be used as a convenience.
Note: In DOM Level 2, the method normalize is
inherited from the Node interface where it was moved.
See also the Document Object Model (DOM) Level 3 Core Specification.
| Field Summary |
|---|
Fields inherited from interface org.w3c.dom.Node ![]() |
|---|
ATTRIBUTE_NODE |
| Method Summary | |
|---|---|
String |
getAttribute
Retrieves an attribute value by name. |
Attr |
getAttributeNode
Retrieves an attribute node by name. |
Attr |
getAttributeNodeNS
Retrieves an Attr node by local name and namespace URI. |
String |
getAttributeNS
Retrieves an attribute value by local name and namespace URI. |
NodeList |
getElementsByTagName
Returns a NodeList of all descendant Elements
with a given tag name, in document order. |
NodeList |
getElementsByTagNameNS
Returns a NodeList of all the descendant
Elements with a given local name and namespace URI in
document order. |
TypeInfo |
getSchemaTypeInfo
The type information associated with this element. |
String |
getTagName
The name of the element. |
boolean |
hasAttribute
Returns true when an attribute with a given name is
specified on this element or has a default value, false
otherwise. |
boolean |
hasAttributeNS
Returns true when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false otherwise. |
void |
removeAttribute
Removes an attribute by name. |
Attr |
removeAttributeNode
Removes the specified attribute node. |
void |
removeAttributeNS
Removes an attribute by local name and namespace URI. |
void |
setAttribute
Adds a new attribute. |
Attr |
setAttributeNode
Adds a new attribute node. |
Attr |
setAttributeNodeNS
Adds a new attribute. |
void |
setAttributeNS
Adds a new attribute. |
void |
setIdAttribute
If the parameter isId is true, this method
declares the specified attribute to be a user-determined ID attribute
. |
void |
setIdAttributeNode
If the parameter isId is true, this method
declares the specified attribute to be a user-determined ID attribute
. |
void |
setIdAttributeNS
If the parameter isId is true, this method
declares the specified attribute to be a user-determined ID attribute
. |
Methods inherited from interface org.w3c.dom.Node ![]() |
|---|
appendChild |
| Method Detail |
|---|

String![]()
![]()
getTagName()
Node.localName is different
from null, this attribute is a qualified name. For
example, in:
<elementExample id="demo"> ... </elementExample> ,
tagName has the value
"elementExample". Note that this is case-preserving in
XML, as are all of the operations of the DOM. The HTML DOM returns
the tagName of an HTML element in the canonical
uppercase form, regardless of the case in the source HTML document.

String![]()
![]()
getAttribute(String
![]()
![]()
name)
name - The name of the attribute to retrieve.
Attr value as a string, or the empty string
if that attribute does not have a specified or