JSFiddle - React, Tailwind, and code Playground

HTML

<p>Here is some text for you to try to copy</p>
<div></div>
<button id="on">Turn on contenteditable</button>
<button id="off">Turn off</button>

CSS

div { width: 50%; height: 300px; border: 1px solid #F00; }
div[contenteditable] { border-color: #0F0; }

JavaScript

$('on').addEvent('click', function () {
    $$('div').setProperty('contenteditable', true);
});

$('off').addEvent('click', function () {
    $$('div').removeProperty('contenteditable');
});