i’m trying to write a very simple wysiwyg editor, where users can simply add bold text, hyperlinks and bullets, after selecting part of the text.. actualy just like CKEditor.
But as far as i know there is no way to add formatting to a textarea. So I would like to know, how do other wysiwyg editors like CKEditor solve this.
The browser based WYSIWYG editors work by building the HTML for the document/text you’re editing. In other words, you’re essentially editing HTML inside the browser and not the text in a
TEXTAREA. You might want to have a look at the source code for Rich Text Editor and check out Mozilla’s Midas Specification before you embark on writing everything from scratch.