Good - here are my 2 cents.
Firstly, I suppose you have an editable element, more than likely a div, and you use it as your WYSIWYG editor. I also assume that you have an Ajax function somewhere that you have configured for a specific keystroke to check the spelling of all (maybe even some) of the contents of the DIV, and it might send you a list of misspelled words.
My idea is 1. Create a range of contents for your editable div, then search for a word using the TextRange object - here: http://msdn.microsoft.com/en-us/library/ms535872%28VS.85%29.aspx . Use the findText method, which searches for text in the document (range) and positions the start and end points of the range to span the search string.
After that, you should copy the text value into a variable, and then build a <Span>, perhaps even set the bottom span style to have a red underline, or even use the image to look like this regular short-wave wave with errors. Set the inner contents of this Span to the value of the original error word. Also, be sure to assign an onclick (or right-click) to this SPAN so that you can perform another search for spelling suggestions later. Great, now you have a standalone SPAN, but it is not yet inserted into the document.
Next step: use the pasteHTML TextRange method to insert the new SPAN into the document, remember that the range should already be determined from the search operation, so you wonβt need to search for the text again (or selecting it)).
Once the span is in the document using pasteHTML, it should be straightforward, just create another div, absolutely position it just under the SPAN, so when the user right-clicks, a context menu appears - filled with Ajax.
After that, it should be a very simple case of creating another range and replacing SPAN with plain text this time.
ALL is a theory, but hope this helps!
You can also check - http://www.aspfree.com/c/a/Code-Examples/Searching-Body-Text-with-textRange-Enter-the-Gecko/ - this will help you make the whole decision in FireFox (not only IE)