Quick Tag Editor functions

Quick Tag Editor functions navigate through the tags within and surrounding the current selection. They remove any tag in the hierarchy, wrap the selection inside a new tag, and show the Quick Tag Editor to let the user edit specific attributes for the tag.

dom.selectChild()

Availability

Dreamweaver 3.

Description

Selects a child of the current selection. Calling this function is equivalent to selecting the next tag to the right in the tag selector at the bottom of the Document window.

Arguments

None.

Returns

Nothing.

dom.selectParent()

Availability

Dreamweaver 3.

Description

Selects the parent of the current selection. Calling this function is equivalent to selecting the next tag to the left in the tag selector at the bottom of the Document window.

Arguments

None.

Returns

Nothing.

dom.stripTag()

Availability

Dreamweaver 3.

Description

Removes the tag from around the current selection, leaving any contents. If the selection has no tags or contains more than one tag, Dreamweaver reports an error.

Arguments

None.

Returns

Nothing.

dom.wrapTag()

Availability

Dreamweaver 3.

Description

Wraps the specified tag around the current selection. If the selection is unbalanced, Dreamweaver reports an error.

Arguments

startTag, {bAlwaysBalance}, {bMakeLegal}

  • The startTag argument is the source that is associated with the opening tag.

  • The bAlwaysBalance argument is a Boolean value that indicates whether to balance the selection before wrapping it. This argument is optional.

  • The bMakeLegal argument is a Boolean value that indicates whether to ensure that the wrap results in valid HTML. This argument is optional.

Returns

Nothing.

Example

The following code wraps a link around the current selection:

 var theDOM = dw.getDocumentDOM(); 
var theSel = theDOM.getSelectedNode(); 
if (theSel.nodeType == Node.TEXT_NODE){ 
    theDOM.wrapTag('<a href="foo.html">'); 
}

dreamweaver.showQuickTagEditor()

Availability

Dreamweaver 3.

Description

Displays the Quick Tag Editor for the current selection.

Arguments

{nearWhat}, {mode}

  • The optional nearWhat argument, if specified, must be either "selection" or "tag selector". If this argument is omitted, the default value is "selection".

  • The optional mode argument, if specified, must be "default", "wrap", "insert", or "edit". If mode is "default" or omitted, Dreamweaver uses heuristics to determine the mode to use for the current selection. The mode argument is ignored if nearWhat is "tag selector".

Returns

Nothing.

Get help faster and easier

New user?