How do you display styles in an HTML text box?

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?

+5
source share
3 answers

. textarea iframe, iframe designMode contentEditable. html- iframe, api, (, ..). , , innerHTML iframe . , , .: https://developer.mozilla.org/En/Rich-Text_Editing_in_Mozilla

- , . , , -, . , html. , IE <br>, Enter, FF <p>. IE <b>, <i> .., FF .

+4

, div. , javascript . textarea - html, . , .

, , .

+5

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.

+3
source

All Articles