>The browser literally highlights the selection so that seems like a solved problem.
It's nowhere close to a solved problem, and is much more complex than this. Give a read through the comments in the OP for a taste of why.
It's nowhere close to a solved problem, and is much more complex than this. Give a read through the comments in the OP for a taste of why.
Maybe there are deep reasons why it's impossible, but they are not well presented in the OP, unfortunately.