JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" id="color-red" name="color" value="Red"> Red
JavaScript
alert(
"The 'checked'-property of this checkbox is: " +
document.getElementById("color-red").checked
);
<input type="checkbox" id="color-red" name="color" value="Red"> Red
alert(
"The 'checked'-property of this checkbox is: " +
document.getElementById("color-red").checked
);