JSFiddle - React, Tailwind, and code Playground

by ariehg

HTML

<textarea class='style'>
    .editable{color:blue;}
</textarea>

CSS

.editable{display:block;}

JavaScript

$$('.style').each(function(t){
    var style = new Element('style.editable[contenteditable=true]',{
        html : t.innerHTML
        , events : {
            mousedown : function(e){
                t.innerHTML = style.innerHTML 
            }   
        }
    }).inject(t,'after');
    t.setStyle('display','none');
});