Practice · Inputs & Files
WYSIWYG Editor
Why this is tricky
This editor is a plain <div contenteditable>, not an <input> or <textarea> — it has no .value. Reading its state means reading innerHTML or textContent, and typing into it means sending keys after clicking inside, not setting a value directly. The toolbar buttons apply formatting to whatever's selected.
Edit this text — select some of it and click a toolbar button.
Initial state.