Tiny WYSIWYG / Rich text editor (Less than 5KB gzipped, 1 file including images)

Sample

How to use

Download and include WYSIWYG.js

Create an element, preferably a div, with an id, in this case "editor".

Add some script:

var editor = WYSIWYG.Create({ id: 'a_unique_id', head: 'styles and what not, for the created iframe', contents: 'body content', div: WYSIWYG.E("editor"), width: 700, height: 300 });

And when you need the content from the editor, just call editor.GetHTML();

You can select which buttons, and in what order, by assigning an array of button ids to "buttons" when calling WYSIWYG.Create(), for ids etc, check the source.

When you are done, just call editor.Destroy();

Why?

I wanted a small, simple rich text editor to play with, that worked in the current crop of browsers. Smallest I could find was around 40KB, with a large number of referenced images and a couple of style sheets, I needed something smaller.
© Anders Hammervald, 2019