JSFiddle - React, Tailwind, and code Playground

by juanojeda

HTML

<div class="decoy" contenteditable="true">
</div>
<pre>
<textarea> </textarea>
</pre>

CSS

.decoy, textarea {
    border: 1px solid red;
    height: 100px;
    width: 300px;
    font-size: 8px
}

JavaScript

$('.decoy').on('mousedown', function(e){
    $('textarea').trigger('focus');
    console.log('something');
    return false;
});
$('textarea').on('change', function(e){
    var text = $(this).val();
    console.log(text);
    return false;
})