Web www.gerd-tentler.de
Version 1.4 (released Apr. 25, 2011) [Download]


Use this script to convert your HTML textareas into a code editor with realtime syntax hilighting. You can create as many editors as you want within your HTML page. When put into a form, the contents can be submitted, e.g. to be written to a file.

Generally, code editing should work on Windows with Internet Explorer 5.5+ and with browsers using the Mozilla 1.3+ engine, i.e. all browsers that support "designMode".

This script was tested with the following systems and browsers:

 Windows:    IE     FF    

If you use another browser or operating system, this script may not work for you - sorry.

NOTE: The script also works with browsers that don't support code editing - a simple textarea will replace the code editor.

List of Supported Languages

Currently the code editor supports the following languages:
  • JavaScript
  • PHP
  • Perl
  • HTML
  • CSS
  • XML
  • SQL

Known Issues

This is a list of things that don't work at the moment. If somebody knows a solution, please tell me! ;-)
  • The tab key does not work correctly with Opera browsers.
  • Tabs are converted into 4   entities when the code is "loaded", and 4   entities will be converted into a single tab character when the code is "saved". Please note that this is just a workaround, since there is no HTML entity for tabs (as far as I know) that works in the browser's design mode.
  • Opera browsers and browsers that use the WebKit engine (e.g. Google Chrome) are not supported at the moment. If you want to test it, just modify line 62.

JavaScript Example

PHP Example

Change Log

Version 1.4

* Added patch for IE 9.
* Inherit CSS float from textarea.

Version 1.3

* Added SQL to the list of supported languages.

Version 1.2

* Added XML to the list of supported languages.
* Removed support for Opera browsers.

Version 1.1

* Added Perl to the list of supported languages.