[Project_owners] Inserting text around selected text in Midas

Neil Deakin enndeakin at sympatico.ca
Fri Nov 12 10:19:08 EST 2004

David Murray wrote:

> Actually, no, I'm still screwed. How can I use getSelection or 
> something but get any HTML values as well? getSelection just seems to 
> return plaintext (ie. "blah <b>blah</b> blah" would just return "blah 
> blah blah").
> David.
> (again)
Sounds like you're using the wrong getSelection method. You should be 
using window.getSelection and not document.getSelection.

Or, you're trying to print the result. window.getSelection() will return 
an nsISelection but it will be automatically converted to a string if 
you try output it directly.

/ Neil

More information about the Project_owners mailing list