I would like to highlight (apply css to) a certain text range, denoted by its start and end position. This is more diffucult than it seems, since there may be other tags within the text, that need to be ignored.
Example:
<div>abcd<em>efg</em>hij</div>
highlight(2, 6)
needs to highlight cdef
without removing the tag.
I have tried already using a TextRange object, but without success.
Thanks in advance!