JSFiddle - React, Tailwind, and code Playground
by technik300
HTML
<input class="input" type="button" value="результат"><br/><br/>
<button type="text" class="button" onclick="button.contentEditable=true;" onblur="button.contentEditable=false">введите текст</button>
CSS
.button{
color: black;
border-color: #333;
border-radius: 2px;
width: 180px;
text-align: left;
padding: 2px 6px;
min-height: 22px;
cursor: text;
background: none;
}
.input{
cursor: pointer;
}
JavaScript
let button = document.querySelector('.button');
let input = document.querySelector('.input');
input.addEventListener('click',function (){
console.log(button.innerText);
});