Can HTML ranges have their endpoint on non-leaf nodes in the middle of a div?

17 Views Asked by At

I have the following div:

<div contenteditable=true>
  <p> Some content here<br></p>
  <p> Some <strong>formatted</strong> content here containing <i>italics</i><strong>then bold</strong></p>
</div>

Is there any way an HTML selection (resp. a range) selected by the user could start or end at the point between the two paragraphs? Or in the general case, when I have a node with some children, can a selection start or end between two leaves? Another example would be the following case, where | denotes the start/end of a selection: </i>|<strong>.

0

There are 0 best solutions below