JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container-text">
<input type="text" id="myText" />
</div>
CSS
.container-text{
position:relative;
}
.container-text input, .container-text textarea{
position:absolute;
top: 0;
left:0;
height:40px;
width:130px;
z-index:99;
}
.container-text input{
z-index:100;
opacity:0;
}
JavaScript
(function(){
if(document.querySelector('#myText')){
var elm = document.createElement('textarea');
elm.className = 'myTextArea';
document.querySelector('.container-text').appendChild(elm);
document.querySelector('#myText').addEventListener('keyup', textChangeUpdate)
}
function textChangeUpdate(){
document.querySelector('.myTextArea').value = document.querySelector('#myText').value;
document.querySelector('.myTextArea').focus();
}
}());