Can you set and/or change the user’s text selection in JavaScript?
Yes. In all browsers you can get one or more Ranges or a TextRange from the user’s selection, and both Range and TextRange have methods for changing the contents of the range. UPDATE You can set the user’s selection by creating a Range and adding it to the Selection object in most browsers and by … Read more