1<input type="checkbox" id="check">
2<a href="#" onclick="check()">click</a>
3<button onclick="check()">button</button>
4<script>
5 function check() {
6 if (document.getElementById('check').checked) {
7 alert("checked");
8 } else {
9 alert("Not checked.");
10 }
11
12 }
13
14</script>
1
2
3
4
5 const cb = document.getElementById('accept');
6console.log(cb.checked);