JSFiddle - React, Tailwind, and code Playground

HTML

<input id="myInput"  type="text"  readonly="readonly" /><br/>
<input id="myButton" type="submit" value="update" />

JavaScript

document.getElementById('myButton').onclick = function() {
    document.getElementById('myInput').removeAttribute('readonly');
};