JSFiddle - React, Tailwind, and code Playground

JavaScript

container = document.body;

var text = $(document.createElement("input"));
text.type = "text";
container.appendChild(text);

var check = $(document.createElement("input"));
check.type = "checkbox";
check.onclick = function(event) {
    if (this.checked) text.enable();
    else text.disable();
};
container.appendChild(check);