Specifications

Chapter 446
Properties and methods of text objects
Each contiguous block of text in an HTML document (for example, the text within a
P tag) is
represented by a JavaScript object. Text objects never have children. The following table describes
the properties and methods of text objects that are taken from DOM Level 1 and used in
Dreamweaver. A bullet () marks read-only properties.
Properties and methods of comment objects
Each HTML comment is represented by a JavaScript object. The following table details the
properties and methods of comment objects that are taken from DOM Level 1 and are used in
Dreamweaver. A bullet () marks read-only properties.
removeAttribute(attrName) Does not return a value. Removes the specified attribute and its value
from the HTML for this tag.
getElementsByTagName(tagName) A
NodeList that can be used to step through child tags of type
tagName (for example, IMG, DIV, and so on).
If the tag argument is LAYER, the function returns all LAYER and
ILAYER tags and all absolutely positioned DIV and SPAN tags.
If the tag argument is INPUT, the function returns all form elements. (If
a name attribute is specified for one or more tagName objects, it must
begin with a letter as required by the HTML 4.01 specification, or the
length of the array returned by this function is incorrect.)
hasChildNodes() A Boolean value that indicates whether the tag has any children.
hasTranslatedAttributes() A Boolean value that indicates whether the tag has any translated
attributes. (This property is not included in DOM Level 1; it was added
to Dreamweaver 3 to support attribute translation.)
Property or method Return value
nodeType • Node.TEXT_NODE
parentNode • The parent tag
childNodes • An empty NodeList
data The actual text string. Entities in the text are represented as a single
character (for example, the text Joseph & I is returned as
Joseph & I).
hasChildNodes() false
Property or method Return value
nodeType • Node.COMMENT_NODE
parentNode • The parent tag
childNodes • An empty NodeList
data The text string between the comment markers (<!-- and -->)
hasChildNodes() false
Property or method Return value