JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<form>
  <input id="Input" type="text" name="input_field" />
</form>
<br>

<button onclick="GFG_Run()">
  click here
</button>

<p id="GFG_down" style="color: green; font-size: 20px; font-weight: bold;">
</p>

JavaScript

function GFG_Run() {
  document.getElementById('Input').readOnly = true;
}