Editing Iframe Content in IE - problem in maintaining text selection
<p>can somebody please guide me the proper way if this is possible?
I was actually trying to make a text editor using iframe with designMode='on'. The buttons in the editing bar are made up of divs where the actions are being triggered by an onclick event which then utilize the execCommand function. I made the whole thing work perfectly in Firefox and other browsers except for IE. I figured that the main reason for this is the inability of IE to maintain focus and keep the range selection to the text inside iframe. This happens everytime I click the buttons to manipulate the texts. My question is, how can I prevent this from happening? I believe using the &lt;a href="javascript:functionHere()"&gt; method could partially solve the problem but it is only limited to a single click command like bold, italic, etc. where no further clicking is involed like clicking another text field to add link or image which causes the selection of the subject text to disappear. Please tell me if you know.</p>

<p>Update:
A simplified version of my code can be found here:
<a href="http://pastebin.com/XrZ4duCb" rel="nofollow">http://pastebin.com/XrZ4duCb</a></p>

<p>You can copy and test it.</p>

<p>I'll try your solution now. Thanks for the replies.</p>

<p>Update:
Managed to fix the codes using different method. However, some bugs can still be observed.
Check here: <a href="http://pastebin.com/qP8sYUH7" rel="nofollow">http://pastebin.com/qP8sYUH7</a></p>

<p>Thanks.</p>
