innerHTML would return:
Hello
world!CROSS-REF CROSS-REF
BC 38
Creating a Behavior
Property Nodes Returns Description
outerHTML ELEMENT_NODE for
Hello world! Returns the HTML source for a
tag, including the tag code
p.outerHTML would return:
Hello world!
data TEXT_NODE ???J. Lowery??? where the tag Returns the text string contained
COMMENT_NODE reads
J. Lowery
within a contiguous block of text
or a comment
* Read-only
DOM methods
Methods, in programming, are functions attached to a particular object, such as the document object.
Dreamweaver includes several methods in the DOM to help manipulate the HTML page. With the node
structure, you can apply these methods to the current document, frameset, frame, or selected object.
Using these methods, your behaviors can inspect the current page and, if desired, change or even delete any
attributes found. Table 2-2 outlines the methods contained in the Dreamweaver DOM.
TABLE 2-2
Dreamweaver DOM Methods
Method Nodes Returns Description
hasChildNodes()* all true or false Determines if current selection
has children
getElementsBy DOCUMENT_NODE NodeList Returns a NodeList array of all
TagName(tagName) ELEMENT_NODE instances of the specified tag on
the current page
getTranslated ELEMENT_NODE string or null Gets the translated value of the
Attribute specified attribute; used in
(attrName) conjunction with Dreamweaver
translators
hasTranslated ELEMENT_NODE true or false Determines if the tag has
Attributes() translated attributes; used in
conjunction with Dreamweaver
translators
getAttribute ELEMENT_NODE string or null Gets the value of the specified
(attrName) attribute
setAttribute ELEMENT_NODE nothing Sets the specified attribute to a
(attrName, specified value
attrValue)
removeAttribute ELEMENT_NODE nothing Deletes the specified attribute
(attrName)
BC 39
Creating a Behavior
Dreamweaver JavaScript API extensions
The Dreamweaver JavaScript API is vast, with more than 600 custom JavaScript functions, enabling the
savvy behavior programmer to use JavaScript to accomplish almost any task that the user can perform in
Dreamweaver.
Pages:
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922