RICH TEXT EDITING
One of the most requested features for web applications was the ability to edit rich text on a web page (also called what you see is what you get, or WYSIWYG, editing). Though no specification covers this, a de facto standard has emerged from functionality originally introduced by Internet Explorer and now supported by Opera, Safari, Chrome, and Firefox. The basic technique is to embed an iframe
containing a blank HTML file in the page. Through the designMode
property, this blank document can be made editable, at which point you're editing the HTML of the page's <body>
element. The designMode
property has two possible values: "off"
(the default) and "on"
. When set to "on"
, an entire document becomes editable (showing a caret), allowing you to edit text as if you were using a word processor complete with keystrokes for making text bold, italic, and so forth.
A very simple, blank HTML page is used as the source of the iframe...