JSFiddle - React, Tailwind, and code Playground

by patilanz

HTML

<input type="text" id="texto" />
<input type="button" id="click" value="Change" />

<div style="height:100px;width:100px;border:1px solid black"></div>

JavaScript

document.getElementById('click').onclick=function(){
  document.getElementsByTagName('div')[0].style.width=document.getElementById('texto').value+'px';
}