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.
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.
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.
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.
Wraps the specified tag around the current selection. If the selection is unbalanced, Dreamweaver reports an error.
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.
var theDOM = dw.getDocumentDOM(); var theSel = theDOM.getSelectedNode(); if (theSel.nodeType == Node.TEXT_NODE){ theDOM.wrapTag('<a href="foo.html">'); }
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".