Skip to main content
Known Participant
February 27, 2007
Question

Wrap Highlighted Text with Tags

  • February 27, 2007
  • 1 reply
  • 351 views
I am trying to write a function to take the highlighted text in design view and get its parent tag, then wrap that whole section with another tag.

using the function dw.getDocumentDOM().source.selectParentTag() to get the selected text's parent does not seem to work. i get the following error: ".. The function balanceTextView() is currently unavailable"

any way to get the same functionality as dw.getDocumentDOM().source.wrapSelection() but to bump it up to the text's parent node then wrap tags around it?
This topic has been closed for replies.

1 reply

kscapAuthor
Known Participant
February 27, 2007
i seem to have figured it out...

dw.getDocumentDOM().selectParent();
dw.getDocumentDOM().source.wrapSelection();