JSFiddle - React, Tailwind, and code Playground

by Valder Black

HTML

<textarea id="txtInput0" contenteditable="true" ></textarea>
<br/>
<div id="txtInput" contenteditable="true" ></div>

CSS

#txtInput0{
    width: 300px;
    height: 40px;
    background-color:lightgrey;
}
#txtInput{
    width: 300px;
    height: 60px;
    font-size:20px;
    background-color:lightgrey;
}

JavaScript

$(document).keydown(function(event) {
        if ((event.ctrlKey) && (event.which == '86' || event.which == '118')) {
            if($('#txtInput').is(':focus'))  {
            //alert('ctrl-v paste is disabled');
                $('#txtInput0').focus();
                $('#txtInput0').select();
                execCommand('paste');
                $('#txtInput').focus();
                a = $('#txtInput0').val("fs");
                alert(a);
                $('#txtInput').html($('#txtInput0').text());
                //event.preventDefault();}
        }}
                     
    });