// Get the checkbox element const checkbox = document.getElementById('myCheckbox'); // Get the checked value const checked = checkbox.checked; if (checked) { // The checkbox is checked } else { // The checkbox is not checked }