getSelection in iFrame

getSelection in iFrame

Hi all,

For my project, I want do a text WYSIWYG editor (like this one).

I have div with contentEditable in iFrame :

  1. <div id="editor" class="K_editor_editing">
  2.     <div class="K_editor_link"><span class="K_editor_linkBold">[b]</span></div>
  3.     <iframe name="frameName_editor" id="frame_editor" src="./myEditor/iframe.php" class="K_editor_iframe"></iframe>
  4. </div>

With this code in iFrame :

  1. <html>
  2.     <head>
  3.         <style>
  4.         </style>
  5.     </head>
  6.     <body>
  7.         <div id="contentIframe" contentEditable="true" >
  8.            Content content <br/> content <br/> content
  9.         </div>
  10.     </body>
  11. </html>


When user click on link (for exemple : bold), I want get selection's user for add balide before and after that..
I have do lots of test but it's impossible.

How can I do ?

Thanks all


Ps: Sorry for my english ! =s