editor

Getting started

Put 82editor into a write form in five minutes.

82editor is a dependency-free JavaScript editor. A PHP or JSP board without a build step needs two CDN lines; an npm project needs one package. No license key, no sign-up, no payment.

From the CDN

The quickest path. Keep your existing <textarea>: the editor takes its place, and when the form submits the HTML goes out as the textarea value.

<link rel="stylesheet" href="https://82editor.com/cdn/v1.0.0/82editor.css">
<script src="https://82editor.com/cdn/v1.0.0/82editor.min.js"></script>

<textarea id="content" name="content"></textarea>
<script>
  Editor82.createEditor('#content', { toolbar: 'board', height: 400 });
</script>

From npm

npm i @82editor/core
import { createEditor } from '@82editor/core';
import '@82editor/core/styles.css';

const editor = createEditor('#editor', {
  placeholder: 'Write something',
  toolbar: 'board',
  height: 400,
});

editor.on('change', (html) => console.log(html));

Reading and writing content

const html = editor.getHTML();   // HTML to save
editor.setHTML('<p>Loaded post</p>');
editor.getText();                // plain text
editor.isEmpty();                // nothing written yet?

Next