Is there a way to change where in a rich text editor the cursor/focus is? When you reset innerHTML (at least in Firefox) the cursor goes to the start of the text, which is bad for typing.

The example I'm doing is an inline spell checker, when you press space it checks the words (with a cache) in the box and parses what was in there to highlight unrecognised words. I've got this part working but the cursor keeps returning to the start which means typing is disturbed and it's unusable.

Any help would be greatly appreciated.