I am trying to add different styles to the text box, for example, bold, different colors, etc.
WYSIWYG editors (like tinyMCE) used on web pages usually do this, but I have problems with how they do it.
You cannot do this:
alt text http://www.yart.com.au/test/html.gif
So how do they achieve this?
. textarea iframe, iframe designMode contentEditable. html- iframe, api, (, ..). , , innerHTML iframe . , , .: https://developer.mozilla.org/En/Rich-Text_Editing_in_Mozilla
designMode
contentEditable
- , . , , -, . , html. , IE <br>, Enter, FF <p>. IE <b>, <i> .., FF .
<br>
<p>
<b>
<i>
, div. , javascript . textarea - html, . , .
, , .
I believe tinymce specifically uses the / iframe table for display purposes (which is replaced in place of the existing text area). After you are ready to save it, all information is copied back to the text field for processing.