JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="testChk"/> test

JavaScript

document.getElementById("testChk").setAttribute("disabled", "disabled");