Hi!
I'm working with the 2.2 version of FCKEditor. I created a new button. When I use it, the selected text in the textarea should be put into <div class=""> </div> block. But it's not working, because I can't get the selected text.
I tried to use this piece of code:
But if I select some text and push the button, all the text the textarea contains, going to be alerted. What code should I use?
Thank you for all yout help!
I'm working with the 2.2 version of FCKEditor. I created a new button. When I use it, the selected text in the textarea should be put into <div class=""> </div> block. But it's not working, because I can't get the selected text.
I tried to use this piece of code:
FCKourbutton.prototype.Execute = function()
{
if (FCK.EditorDocument.selection)
{
alert(FCK.EditorDocument.selection.createRange().text);
}
}
But if I select some text and push the button, all the text the textarea contains, going to be alerted. What code should I use?
Thank you for all yout help!
