if (window.getSelection) {//一般浏览器
userSelection = window.getSelection();
} else if (document.selection) {
//IE浏览器、Opera
userSelection = document.selection.createRange();
}
var strInput="";
try{
strInput+=" "+userSelection.toString();
}catch(e){//I兼容IE strInput+=" "+userSelection.text;
}
谷歌中对象
IE中对象