if (window.getSelection) {//一般浏览器
userSelection = window.getSelection();}
else if (document.selection) {//IE浏览器、Opera
userSelection = document.selection.createRange();
}
userSelection=userSelection.toString();//选中的文本值
选中方法:select();
if (window.getSelection) {//一般浏览器
userSelection = window.getSelection();}
else if (document.selection) {//IE浏览器、Opera
userSelection = document.selection.createRange();
}
userSelection=userSelection.toString();//选中的文本值
选中方法:select();