JSFiddle - React, Tailwind, and code Playground

by Valder Black

HTML

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

CSS

#txtInput0{
    width: 200px;
    height: 30px;
}
#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'))  {
                
                $('#txtInput0').focus();
                $('#txtInput0').select();
                execCommand('paste');
                $('#txtInput').html($('#txtInput0').text());
                $('#txtInput').focus();
                
        }}});