Class: Element

sync.api.dom.Element

new Element(id)

Constructor - should not be called directly.
Parameters:
Name Type Description
id string The id of the HTML node representing the XML element.
Source:

Extends

Methods

getAttribute(name) → {string}

Returns the value of the attribute with a given name.
Parameters:
Name Type Description
name string The name of the attribute.
Source:
Returns:
Type
string

getAttributeNS(namespace, name) → {string}

Returns the value of the attribute with a given name.
Parameters:
Name Type Description
namespace string The namespace of the attribute.
name string The name of the attribute.
Source:
Returns:
Type
string

getAttributes() → {Object}

Return the attributes of the XML node that corresponds to the given HTML node.
Source:
Returns:
The attributes stored in an object with the attribute names as keys and with a descriptor object as value. The descriptor contains: - the value of the object. - whether it's value comes from DTD or not. - whether the attribute is hidden.
Type
Object

getChildNodes() → {Array.<sync.api.dom.Node>}

Returns the node's children.
Inherited From:
Source:
Returns:
The child nodes of the node.
Type
Array.<sync.api.dom.Node>

getContent() → {string}

Returns a string that represents the content of the XML node where start and end tags are represented by the '\0' character.
Inherited From:
Source:
Returns:
The content.
Type
string

getElementsByTagName(tagName) → {Array.<sync.api.dom.Node>}

Return all node's descendants with a given tag name.
Parameters:
Name Type Description
tagName String The tag name.
Inherited From:
Source:
Returns:
all node's descendants with a given tag name.
Type
Array.<sync.api.dom.Node>

getParent() → {sync.api.dom.Node}

Returns the parent node.
Inherited From:
Source:
Returns:
The parent node.
Type
sync.api.dom.Node

getTagName() → {string}

Returns the tag name of the element.
Source:
Returns:
The tag name of the element.
Type
string

getTextContent() → {String}

Return the text content of the current node.
Inherited From:
Source:
Returns:
The text content of the current node.
Type
String

getType() → {number}

Returns the node type.
Inherited From:
Source:
Returns:
Type
number