JSFiddle - React, Tailwind, and code Playground

by fletch

JavaScript

var myCheckbox = $("<input/>", {
    type: "checkbox"
});

myCheckbox.attr("checked", true);
//doesn't work using the line below either
//myCheckbox.attr("checked", "checked");

$("body").append(myCheckbox);

var clone = myCheckbox.clone();

$("body").append(clone);