We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript在开发文档的过程中,需要获取选中的内容进行设置,这里整理一下相关知识点。
与用户选中区域相关的两个对象分别是Selection和Range对象。
let selection = window.getSelection(); let range = selection.getRangeAt(0) let selText= selection && selection.toString();
selection 就是一个Selection对象,range表示一个Range对象,selText表示选中的文本
##注意:仅在Chrome下测试完成,IE需要兼容处理
The text was updated successfully, but these errors were encountered:
No branches or pull requests
JavaScript在开发文档的过程中,需要获取选中的内容进行设置,这里整理一下相关知识点。
与用户选中区域相关的两个对象分别是Selection和Range对象。
selection 就是一个Selection对象,range表示一个Range对象,selText表示选中的文本
##注意:仅在Chrome下测试完成,IE需要兼容处理
The text was updated successfully, but these errors were encountered: