假设我们有一些段落。
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
<p>when an unknown printer took a galley of type and scrambled it to make a</p>
用鼠标,我从其中任何一个中选择了部分文本。所以这就是我如何在此之后或在获取阶段获取所选文本的方法。更好的是,这个文本的容器是相同的。
有趣的是,我
window.getSelection()只考虑输入。但是用鼠标选择的所有内容都会在其中选择。答案就在我的眼皮底下。