-
说明
-
作者: King
-
分类:计算机
-
Window 对象定义和用法
getSelection() 方法表示用户选择的文本范围或光标的当前位置。
语法
window.getSelection();
浏览器支持





所有主要浏览器都支持 focus() 方法
实例
实例
读取选中的内容:
function foo() { let selObj = window.getSelection(); alert(selObj.toString());}知识兔 »
Window 对象
-
我在这里:
-
首页
▶
-
计算机
▶
-
Window getSelection() 方法