I am trying to create a cross browser JS function to get selected text ... does anybody have anything better than what I am using?
function GetSelectedText()
{
var retval='';
<%If mozilla Then%>
sel=ce.GetSelection();
retval=sel.focusNode.textContent.substr(sel.anchorOffset,sel.focusOffset-sel.anchorOffset);
<%ElseIf IE Then%>
sel=ce.GetSelection().createRange();
retval=sel.htmlText;
<%End If%>
return retval;
}