JavaScript获取鼠标左键选中的内容 function f(){ var choose = rangy.getSelection().toString(); document.getElementById("t1").innerHTML=choose; };