js获取网页上选中的文字
<script language="javascript">
function getSelectText(){
if(document.selection){
return document.selection.createRange().text;// for IE
}else{
return document.getSelection(); // for firefox
}
}
</script>
<body onmouseup="alert(getSelectText())">
拖动鼠标选择文字
</body>