I want to create a function to see if a checkbox is checked or not and if so, run updateDocs().
I created the below but const isChecked = document.querySelector('#isPaperless'); does not seem to be correct. How is this done?
isChecked() {
const isChecked = document.querySelector('#isPless');
if (isChecked) {
this.edocsService.updateEdocsStatus();
}
}
<label htmlFor="isPless">
<input id="isPless" name="isPless" type="checkbox" /> I want to receive my policy documents
</label>
if (document.getElementById("isPless").checked) ...