html checkbox if checked code example
Example 1: if checkbox is checked
if ($('#id_input').is(':checked')) { }
Example 2: get the state of a checkbox
function checkAddress()
{
var chkBox = document.getElementById('checkAddress');
if (chkBox.checked)
{
// ..
}
}
Example 3: how to check if input is checked javascript
const cb = document.getElementById('accept');
console.log(cb.checked);