0
所以我有多个孩子第一个CONTENTEDITABLE DIV:contenteditable在文本范围内选择了哪些chlidren?
<div id="editor" contenteditable="true">
<p>Paragraph1</p>
<p>Paragraph2</p>
<p>Paragraph3</p>
<p>Paragraph4</p>
</div>
因此,与window.getSelection()
我得到的是选择什么样的文字,我知道,如果它startContainer, startOffset
我能得到其中的范围开始,endContainer, endOffset
在那里结束。 但是,如果我的选择横跨多个孩子段落,我怎么知道选择了哪些孩子?