JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="other" value="100" readonly="true" />
<input type="text" id="snack" value="56" readonly="true" />
<button type="button" id="button">Click</button>

JavaScript

var el = document.getElementById('snack');
document.getElementById('button').onclick = function showHide4() {
    el.readOnly = false;
    el.style.backgroundColor = "#fdd";
    el.focus();
    el.value = el.value;
};