用javascript获取选中的文字
function getSelectText() {
return document.selection && document.selection.createRange().text || window.getSelection && window.getSelection() || document.getSelection && document.getSelection() || '';
}
function getSelectText()
{
var txt = null;
if (window.getSelection){ // mozilla FF
txt = window.getSelection();
}else if (document.getSelection){
txt = document.getSelection();
}else if (document.selection){ //IE
txt = document.selection.createRange().text;
}
return txt;
}