Home > Element Reference : Element

Contents

### Element

A generic element. This is the type of all HTML and XML elements as defined by the DOM.

#### Properties and Methods:

Properties and Methods inherited from Node

getAttribute ( name ) DOM0

Returns the value of the attribute with the given name from the element.

getAttributeNS ( namespace , name ) DOM2

Returns the value of the attribute with the given name and namespace from the element.

getAttributeNode ( name ) DOM0

Returns an Attr object with the given name from the element. This can be used to manipulate the attribute.

getAttributeNodeNS ( namespace , name ) DOM2

Returns an Attr object with the given name and namespace from the element. This can be used to manipulate the attribute.

getElementsByTagName ( name ) DOM0

Returns an array of all the child elements of the element that have the given tag name.

getElementsByTagNameNS ( namespace , name ) DOM2

Returns an array of all the child elements of the element that have the given tag name and the given namespace. The namespace argument should be the URI of the namespace.

hasAttribute ( namespace , name ) DOM2

Returns true if the attribute with the given name and namespace exists on the element.

hasAttributeNS ( namespace , name ) DOM2

Returns true if the attribute with the given name and namespace exists on the element.

removeAttribute ( name ) DOM0

Removes the attribute with the given name from the element.

removeAttributeNS ( namespace , name ) DOM2

Removes the attribute with the given name and namespace from the element.

removeAttributeNode ( attr ) DOM0

Remove the attribute indicated by the given Attr from the element. In Mozilla, this is currently not implemented for XUL elements.

setAttribute ( name , value ) DOM0

Changes the value of the attribute with the given name on the element to a new value given by the second argument.

setAttributeNS ( namespace , name , value ) DOM2

Changes the value of the attribute with the given name and namespace on the element to a new value given by the third argument.

setAttributeNode ( attr ) DOM0

Adds or changes the attribute indicated by the given Attr to the element. In Mozilla, this is currently not implemented for XUL elements.

setAttributeNodeNS ( attr ) DOM2

Adds or changes the attribute indicated by the given Attr and namespace to the element. In Mozilla, this is currently not implemented for XUL elements.

tagName DOM0

The name of the element. For example, if the element is a box, the tagName is box. This property is read-only.

Copyright (C) 1999 - 2002 XULPlanet.com