I have a div and there is a text in it.I want a part of that text to be selected programmatically according position value of characters.
<div id="textdiv">
Hello world. I am a friend.
</div>
I want "llo world" part to be selected(I mean highlighted/selected like making selection of content in an input/textarea ). In that case position values are first (3) and last (10).
How can i do that programmatically using position values?