JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="inputID" value="abc" ></input>
JavaScript
document.getElementById('inputID').readOnly = true;
<input type="text" id="inputID" value="abc" ></input>
document.getElementById('inputID').readOnly = true;