How to get status of a CheckBox using JS?

How to get status of a CheckBox using JS?

1 Like
  1. Get the instance of the checkbox by using some DOM node finder method.
    const checkbox = document.getElementById('your-checkbox-id')
  2. Simply check the checked state of the checkbox node instance:
    checkbox.checked === true // true if checkbox was checked