Editable Regions Sample

This example demonstrates the features of Microsoft® Internet Explorer that enable users to edit the content of an HTML element directly from the browser.

This HTML editor is a DIV element set to be content-editable. Any valid HTML content (text, images, form controls, etc.) can be pasted and edited in this editor.

HTMLEditor (Content-Editable DIV)

This text editor is a TEXTAREA element and is content-editable by default. Only text can be edited in this tool. However, you can draft HTML in the TEXTEditor and press the Append to HTMLEditor button to see the result appended to HTMLEditor. The Append to TextEditor button reverses this process by appending the HTMLEditor's HTML as text to the TEXTEditor.


TEXTEditor (TEXTAREA)


Both editors use the same function to activate or deactivate editing. The function uses the isContentEditable property to test whether editing is active. Accordingly, the contentEditable property is then reversed to reset editing.