I'm not sure what you mean by "element as a variable", but what you can do is us common JS
document
methods to select elements in the HTML structure. In the example above, if you wanted to get the checkbox, you can see it has
id="myCheckboxId"
which allows JS to identify it as a unique element on the screen. So you can select it via:
const checkbox = document.getElementById('myCheckboxId');
const isChecked = checkbox.checked;
Document.getElementById() - Web APIs | MDN[
^]
Document.getElementsByClassName() - Web APIs | MDN[
^]
Document.querySelector() - Web APIs | MDN[
^]