I\'m extending a WYSIWYG HTML editor (for Firefox), I want to add tags around a selection. I can\'t find a function to accomplish this in the Mozilla Midas specification.
window.getSelection() will return an object. You can use the returned selection object as a string by calling the objects .toString() method.
var selObj = window.getSelection(); var selectedText = selObj.toString();
https://developer.mozilla.org/en/DOM/window.getSelection