JSFiddle - React, Tailwind, and code Playground

by Chris Rebert

HTML

<input type="checkbox" id="a">

JavaScript

var a = document.getElementById('a');
a.checked = true;
alert(a.getAttribute('checked'));