Set Selected Text inside of page body
I have a rather strange question. I am running up against a scenario where I need to change the selected text inside the body of a web page. I have an event firing that needs to move the cursor and selection from one span tag inside of a p tag to the next. Essentially what I have is this:
<p>
<span>test</span> <span>test</span> <span>test</span>
</p>
This page is written specifically for firefox and I'm using design mode so that the user can enter text. I have code so that when my event fires I move from one span to the next but I need to be able to select the contents of the span tag so that if the user starts typing it'll replace the selected text.
Any insight anyone can provide is greatly appreciated.
Casey
|