Properties And Methods Of Html Tag Objects - MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

Properties and methods of HTML tag objects

Every HTML tag is represented by a JavaScript object. Tags are organized in a tree hierarchy,
where tag
is a parent of tag
x
content <y>y content</y> more x content.</x>
well-formed.
The following table lists the properties and methods of tag objects in Dreamweaver, along with
their return values or explanations. A bullet (•) marks read-only properties.
Property or method
nodeType •
parentNode •
childNodes •
tagName •
attrName
innerHTML
outerHTML
getAttribute(attrName)
getTranslatedAttribute(attrName)
setAttribute(attrName, attrValue)
removeAttribute(attrName)
72
Chapter 4: The Dreamweaver Document Object Model
, if
falls completely within
y
y
Return value
Node.ELEMENT_NODE
The parent tag. If this is the
object returns.
A
that contains all the immediate children of the tag.
NodeList
The HTML name for the tag, such as
value always returns in uppercase letters.
A string that contains the value of the specified tag attribute.
tag.attrName
reserved word in the JavaScript language (for example,
). In this case, use
class
The source code that is contained between the opening tag
and the closing tag.For example, in the code
b>, World!</p>
If you write to this property, the DOM tree immediately
updates to reflect the new structure of the document. (This
property is not included in DOM Level 1, but Internet Explorer
4.0 supports it.)
The source code for this tag, including the tag. For the
previous example code,
b>, World!</p>
immediately updates to reflect the new structure of the
document. (This property is not included in DOM Level 1, but
Internet Explorer 4.0 supports it.)
The value of the specified attribute if it is explicitly specified;
otherwise.
null
The translated value of the specified attribute or the same
value that
getAttribute()
translated. (This property is not included in DOM Level 1; it
was added to Dreamweaver 3 to support attribute
translation.)
Does not return a value. Sets the specified attribute to the
specified value: for example,
"image/roses.gif")
Does not return a value. Removes the specified attribute and
its value from the HTML for this tag.
's opening and closing tags (
x
). For this reason, your code should be
tag, the document
HTML
cannot be used if the
attrName
getAttribute()
,
returns
p.innerHTML
p.outerHTML
. If you write to this property, the DOM tree
returns if the attribute's value is not
img.setAttribute("src",
.
<x>x
,
, or
. This
IMG
A
BLINK
attribute is a
and
setAttribute()
<p><b>Hello</
.
<b>Hello</b>, World!
returns
<p><b>Hello</
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents